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[] { });
        }
示例#2
0
 public static bool IsCollectionOfBoundedSet(this ITypeSpec spec, IObjectSpec elementSpec)
 {
     return(spec.IsCollection && elementSpec.IsBoundedSet());
 }
示例#3
0
 public static bool IsCollectionOfBoundedSet(this ITypeSpec spec, IObjectSpec elementSpec) {
     return spec.IsCollection && elementSpec.IsBoundedSet();
 }