Example #1
0
 public static CollectionGetByIdMethod ForCollectionClass(OdcmClass odcmClass, OdcmProjection projection = null)
 {
     return(new CollectionGetByIdMethod(odcmClass, projection)
     {
         DefiningInterface = NamesService.GetCollectionInterfaceName(odcmClass, projection)
     });
 }
Example #2
0
 public static CollectionGetByIdIndexer ForCollectionClass(OdcmEntityClass odcmClass, OdcmProjection projection)
 {
     return(new CollectionGetByIdIndexer(odcmClass, projection)
     {
         DefiningInterface = NamesService.GetCollectionInterfaceName(odcmClass, projection)
     });
 }
Example #3
0
 public static Interface ForCountableCollection(OdcmClass odcmClass)
 {
     return(new Interface
     {
         Identifier = NamesService.GetCollectionInterfaceName(odcmClass),
         Methods = global::Vipr.Writer.CSharp.Lite.Methods.ForCountableCollectionInterface(odcmClass)
     });
 }
 protected FetcherNavigationCollectionProperty(OdcmProperty odcmProperty)
     : base(odcmProperty)
 {
     CollectionType = new Type(NamesService.GetCollectionTypeName((OdcmClass)odcmProperty.Projection.Type));
     FieldName      = NamesService.GetFetcherCollectionFieldName(odcmProperty);
     InstanceType   = NamesService.GetConcreteTypeName(odcmProperty.Projection.Type);
     Type           = new Type(NamesService.GetCollectionInterfaceName((OdcmClass)odcmProperty.Projection.Type, odcmProperty.Projection));
 }
Example #5
0
        public static IEnumerable <Type> ForCollectionClass(OdcmClass odcmClass)
        {
            var retVal = new List <Type>();

            foreach (var projection in odcmClass.DistinctProjections())
            {
                retVal.Add(new Type(NamesService.GetCollectionInterfaceName(odcmClass, projection)));
            }

            return(retVal);
        }
Example #6
0
        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);
        }