本文整理汇总了C#中EntityInfo.HasTable方法的典型用法代码示例。如果您正苦于以下问题:C# EntityInfo.HasTable方法的具体用法?C# EntityInfo.HasTable怎么用?C# EntityInfo.HasTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EntityInfo
的用法示例。
在下文中一共展示了EntityInfo.HasTable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GatherConditionsForEntityTypeMapping
private static void GatherConditionsForEntityTypeMapping(EntityInfo info, EntityTypeMapping etm)
{
foreach (var frag in etm.MappingFragments())
{
Debug.Assert(frag.StoreEntitySet.Target != null, "Found a MappingFragment with an unknown StoreEntitySet binding");
Debug.Assert(
frag.StoreEntitySet.Target.EntityType.Target != null, "Found an S-Side entity set with an unknown entity binding");
if (frag.StoreEntitySet.Target != null
&& frag.StoreEntitySet.Target.EntityType.Target != null
&& info.HasTable(frag.StoreEntitySet.Target.EntityType.Target) == false)
{
var table = frag.StoreEntitySet.Target.EntityType.Target;
var ti = new TableInfo(table);
ti.EntityTypeMappingKind = etm.Kind;
info.Tables.Add(table, ti);
}
foreach (var cond in frag.Conditions())
{
info.Conditions.Add(cond);
}
}
}
示例2: GatherScalarsForEntityTypeMapping
private static void GatherScalarsForEntityTypeMapping(EntityInfo info, EntityTypeMapping etm)
{
foreach (var frag in etm.MappingFragments())
{
Debug.Assert(frag.StoreEntitySet.Target != null, "frag.StoreEntitySet.Target should not be null");
Debug.Assert(
frag.StoreEntitySet.Target.EntityType.Target != null, "frag.StoreEntitySet.Target.EntityType.Target should not be null");
if (frag.StoreEntitySet.Target != null
&& frag.StoreEntitySet.Target.EntityType.Target != null
&& info.HasTable(frag.StoreEntitySet.Target.EntityType.Target) == false)
{
var table = frag.StoreEntitySet.Target.EntityType.Target;
var ti = new TableInfo(table);
ti.EntityTypeMappingKind = etm.Kind;
info.Tables.Add(table, ti);
}
foreach (var sp in frag.ScalarProperties())
{
if (info.KeyProperties.Contains(sp.Name.Target))
{
info.KeyScalars.Add(sp);
}
else
{
info.NonKeyScalars.Add(sp);
}
}
foreach (var cp in frag.ComplexProperties())
{
GatherScalarsFromComplexProperty(info, cp);
}
}
}