public IEnumerable GetBoundedSet(IObjectSpec spec) { if (spec.IsBoundedSet()) { if (spec.IsInterface) { IList <object> instances = new List <object>(); // ReSharper disable once LoopCanBeConvertedToQuery // LINQ needs cast - need to be careful with EF - safest to leave as loop foreach (var subSpec in GetLeafNodes(spec)) { foreach (var instance in Instances((IObjectSpec)subSpec)) { instances.Add(instance); } } return(instances); } return(Instances(spec)); } return(new object[] { }); }
public static bool IsCollectionOfBoundedSet(this ITypeSpec spec, IObjectSpec elementSpec) { return(spec.IsCollection && elementSpec.IsBoundedSet()); }
public static bool IsCollectionOfBoundedSet(this ITypeSpec spec, IObjectSpec elementSpec) { return spec.IsCollection && elementSpec.IsBoundedSet(); }