本文整理汇总了C#中SolrNet.Mapping.MappingManager.GetFields方法的典型用法代码示例。如果您正苦于以下问题:C# MappingManager.GetFields方法的具体用法?C# MappingManager.GetFields怎么用?C# MappingManager.GetFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SolrNet.Mapping.MappingManager
的用法示例。
在下文中一共展示了MappingManager.GetFields方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddAndGet
public void AddAndGet()
{
var mgr = new MappingManager();
mgr.Add(typeof (Entity).GetProperty("Id"), "id");
var fields = mgr.GetFields(typeof (Entity));
Assert.AreEqual(1, fields.Count);
}
示例2: Add_duplicate_property_overwrites
public void Add_duplicate_property_overwrites() {
var mgr = new MappingManager();
mgr.Add(typeof (Entity).GetProperty("Id"), "id");
mgr.Add(typeof (Entity).GetProperty("Id"), "id2");
var fields = mgr.GetFields(typeof (Entity));
Assert.AreEqual(1, fields.Count);
Assert.AreEqual("id2", fields.First().Value.FieldName);
}
示例3: No_Mapped_type_returns_empty
public void No_Mapped_type_returns_empty()
{
var mgr = new MappingManager();
var fields = mgr.GetFields(typeof (Entity));
Assert.AreEqual(0, fields.Count);
}
示例4: Inherited_gets_id_property_correctly2
public void Inherited_gets_id_property_correctly2()
{
var mgr = new MappingManager();
mgr.Add(typeof(InheritedEntity).GetProperty("Id"), "id");
Assert.IsTrue(mgr.GetFields(typeof(InheritedEntity)).ContainsKey("id"), "InheritedEntity contains id field");
Assert.IsTrue(mgr.GetFields(typeof(Entity)).ContainsKey("id"), "Entity contains id field");
}
示例5: Inherited
public void Inherited()
{
var mgr = new MappingManager();
mgr.Add(typeof(Entity).GetProperty("Id"), "id");
mgr.Add(typeof(InheritedEntity).GetProperty("Description"), "desc");
var entityFields = mgr.GetFields(typeof(Entity));
Assert.AreEqual(1, entityFields.Count);
var inheritedEntityFields = mgr.GetFields(typeof(InheritedEntity));
Assert.AreEqual(2, inheritedEntityFields.Count);
}
示例6: GetFields_doesnt_admit_null
public void GetFields_doesnt_admit_null()
{
var mgr = new MappingManager();
mgr.GetFields(null);
}
示例7: Add_property_only
public void Add_property_only()
{
var mgr = new MappingManager();
var property = typeof (Entity).GetProperty("Id");
mgr.Add(property);
var fields = mgr.GetFields(typeof (Entity));
Assert.AreEqual(1, fields.Count);
Assert.AreEqual("Id", fields.First().Value.FieldName);
}