protected FetcherNavigationCollectionProperty(OdcmProperty odcmProperty)
     : base(odcmProperty)
 {
     CollectionType = new Type(NamesService.GetCollectionTypeName((OdcmClass)odcmProperty.Type));
     FieldName      = NamesService.GetFetcherCollectionFieldName(odcmProperty);
     InstanceType   = NamesService.GetFetcherTypeName(odcmProperty.Type);
     Type           = new Type(NamesService.GetCollectionInterfaceName((OdcmClass)odcmProperty.Type));
 }
Beispiel #2
0
 public static Field ForNavigationCollectionProperty(OdcmProperty property)
 {
     return(new Field
     {
         Name = NamesService.GetFetcherCollectionFieldName(property),
         Type = new Type(NamesService.GetCollectionTypeName((OdcmClass)property.Type))
     });
 }
 private ConcreteNavigationCollectionAccessorProperty(OdcmProperty odcmProperty) : base(odcmProperty)
 {
     CollectionType = new Type(NamesService.GetCollectionTypeName((OdcmClass)odcmProperty.Type));
     FieldName      = NamesService.GetConcreteFieldName(odcmProperty);
     InstanceType   = NamesService.GetConcreteTypeName(odcmProperty.Type);
     Type           = new Type(new Identifier("global::System.Collections.Generic", "IList"),
                               new Type(NamesService.GetConcreteTypeName(odcmProperty.Type)));
 }
Beispiel #4
0
 public static Class ForCollection(OdcmClass odcmClass)
 {
     return(new Class
     {
         AccessModifier = "internal ",
         BaseClass = new Type(NamesService.GetExtensionTypeName("QueryableSet"),
                              new Type(NamesService.GetConcreteInterfaceName(odcmClass))),
         Constructors = global::CSharpWriter.Constructors.ForCollection(odcmClass),
         Interfaces = global::CSharpWriter.Interfaces.ForCollection(odcmClass),
         Identifier = NamesService.GetCollectionTypeName(odcmClass),
         Methods = global::CSharpWriter.Methods.ForCollection(odcmClass),
         Indexers = global::CSharpWriter.Indexers.ForCollection(odcmClass)
     });
 }
Beispiel #5
0
        private void Write(CollectionConstructor collectionConstructor)
        {
            _("internal {0}(global::Microsoft.OData.Client.DataServiceQuery inner," +
              "{1} context," +
              "object entity," +
              "string path)" +
              ": base(inner, context, entity as {2}, path)",
              NamesService.GetCollectionTypeName(collectionConstructor.OdcmClass).Name,
              NamesService.GetExtensionTypeName("DataServiceContextWrapper"),
              NamesService.GetExtensionTypeName("EntityBase"));
            _("{");

            _("}");
        }