本文整理汇总了C#中Microsoft.Test.Taupo.Contracts.EntityModel.EntityModelSchema.Remove方法的典型用法代码示例。如果您正苦于以下问题:C# EntityModelSchema.Remove方法的具体用法?C# EntityModelSchema.Remove怎么用?C# EntityModelSchema.Remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Test.Taupo.Contracts.EntityModel.EntityModelSchema
的用法示例。
在下文中一共展示了EntityModelSchema.Remove方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Fixup
/// <summary>
/// Remove navigation properties defined on derived types
/// </summary>
/// <param name="model">The model to fix up</param>
public void Fixup(EntityModelSchema model)
{
foreach (var function in model.Functions.ToList().Where(f => f.Annotations.OfType<ServiceOperationAnnotation>().Any(so => so.IsAction)))
{
model.Remove(function);
}
}
示例2: Fixup
/// <summary>
/// Remove bags and corresponding features in model for EF provider
/// </summary>
/// <param name="model">The model to fix up</param>
public void Fixup(EntityModelSchema model)
{
foreach (var namedStructuralType in model.ComplexTypes.OfType<NamedStructuralType>().Concat(model.EntityTypes.OfType<NamedStructuralType>()))
{
foreach (var bag in namedStructuralType.Properties.Where(p => p.PropertyType.HasCollection()))
{
var collectionType = bag.PropertyType as CollectionDataType;
bag.PropertyType = collectionType.ElementDataType;
}
}
foreach (var function in model.Functions.ToArray().Where(f => f.ReturnType != null && f.ReturnType.HasCollection()))
{
model.Remove(function);
}
foreach (var function in model.Functions.ToArray().Where(f => f.Parameters.Any(p => p.DataType.HasCollection())))
{
model.Remove(function);
}
}
示例3: Fixup
/// <summary>
/// Remove spatial properties and functions
/// </summary>
/// <param name="model">The model to fix up</param>
public void Fixup(EntityModelSchema model)
{
foreach (var structuralType in model.EntityTypes.OfType<NamedStructuralType>().Concat(model.ComplexTypes.OfType<NamedStructuralType>()))
{
foreach (var spatialProperty in structuralType.Properties.ToArray().Where(p => p.PropertyType.IsSpatial()))
{
structuralType.Properties.Remove(spatialProperty);
}
}
foreach (var function in model.Functions.ToList().Where(f => (f.ReturnType != null && f.ReturnType.IsSpatial()) || f.Parameters.Any(p => p.DataType.IsSpatial())))
{
model.Remove(function);
}
}