コード例 #1
0
        public static IEnumerable <Indexer> ForCollection(OdcmEntityClass odcmClass)
        {
            var retVal = new List <Indexer>();

            foreach (var projection in odcmClass.DistinctProjections())
            {
                retVal.Add(CollectionGetByIdIndexer.ForCollectionClass(odcmClass, projection));
            }

            return(retVal);
        }
コード例 #2
0
ファイル: Interface.cs プロジェクト: vikyding/Vipr
        public static IEnumerable <Interface> ForCollection(OdcmEntityClass odcmClass)
        {
            var interfaces = new List <Interface>();

            foreach (var projection in odcmClass.DistinctProjections())
            {
                var @interface = new Interface
                {
                    Attributes = global::Vipr.Writer.CSharp.Lite.Attributes.ForCollectionInterface,
                    Identifier = NamesService.GetCollectionInterfaceName(odcmClass, projection),
                    Namespace  = NamesService.GetNamespaceName(odcmClass.Namespace),
                    Methods    = global::Vipr.Writer.CSharp.Lite.Methods.ForCollectionInterface(odcmClass, projection),
                    Indexers   = IndexerSignature.ForCollectionInterface(odcmClass, projection),
                    Interfaces = new[] { new Type(NamesService.GetExtensionTypeName("IReadOnlyQueryableSetBase"), new Type(NamesService.GetConcreteInterfaceName(odcmClass))) }
                };

                interfaces.Add(@interface);
            }

            return(interfaces);
        }