Esempio n. 1
0
 public static Attribute ForLowerCaseProperty()
 {
     return(new Attribute
     {
         Type = new Type(NamesService.GetExtensionTypeName("LowerCasePropertyAttribute"))
     });
 }
Esempio n. 2
0
 public new static FetcherNavigationProperty ForConcrete(OdcmProperty odcmProperty)
 {
     return(new FetcherNavigationCollectionProperty(odcmProperty)
     {
         DefiningInterface = NamesService.GetFetcherInterfaceName(odcmProperty.Class),
     });
 }
Esempio n. 3
0
 public static FetcherExpandMethod ForConcrete(OdcmClass odcmClass)
 {
     return(new FetcherExpandMethod(odcmClass)
     {
         DefiningInterface = NamesService.GetFetcherInterfaceName(odcmClass)
     });
 }
Esempio n. 4
0
 public ObsoletedNavigationProperty(OdcmProperty odcmProperty) : base(odcmProperty)
 {
     Type = odcmProperty.IsCollection
         ? new Type(new Identifier("global::System.Collections.Generic", "IList"),
                    new Type(NamesService.GetConcreteTypeName(odcmProperty.Type)))
         : new Type(NamesService.GetConcreteTypeName(odcmProperty.Type));
 }
Esempio n. 5
0
 protected FetcherNavigationProperty(OdcmProperty odcmProperty) : base(odcmProperty)
 {
     FieldName    = NamesService.GetFetcherFieldName(odcmProperty);
     InstanceType = NamesService.GetFetcherTypeName(odcmProperty.Type);
     PrivateSet   = true;
     Type         = new Type(NamesService.GetFetcherInterfaceName(odcmProperty.Type));
 }
 public static ConcreteNavigationProperty ForConcrete(OdcmProperty odcmProperty)
 {
     return(new ConcreteNavigationProperty(odcmProperty)
     {
         DefiningInterface = NamesService.GetConcreteInterfaceName(odcmProperty.Class),
     });
 }
Esempio n. 7
0
 private void Write(ConcreteUpcastMethod method)
 {
     WriteSignature(method);
     using (_builder.IndentBraced)
     {
         _("return ({0}) this;", NamesService.GetFetcherInterfaceName(method.DerivedType));
     }
 }
 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)));
 }
Esempio n. 9
0
 public EnsureQueryMethod(OdcmClass odcmClass)
 {
     Visibility           = Visibility.Private;
     Name                 = "EnsureQuery";
     FetchedType          = new Type(NamesService.GetConcreteTypeName(odcmClass));
     FetchedTypeInterface = new Type(NamesService.GetConcreteInterfaceName(odcmClass));
     ReturnType           = new Type(NamesService.GetExtensionTypeName("IReadOnlyQueryableSet"), new Type(NamesService.GetConcreteInterfaceName(odcmClass)));
 }
Esempio n. 10
0
 public static Field ForConcreteNavigationCollectionProperty(OdcmProperty property)
 {
     return(new Field
     {
         Name = NamesService.GetConcreteFieldName(property),
         Type = new Type(NamesService.GetExtensionTypeName("EntityCollectionImpl"), new Type(NamesService.GetConcreteTypeName((OdcmClass)property.Type)))
     });
 }
Esempio n. 11
0
 public static Field ForFetcherNavigationCollectionProperty(OdcmProperty property)
 {
     return(new Field
     {
         Name = NamesService.GetFetcherCollectionFieldName(property),
         Type = new Type(NamesService.GetCollectionTypeName((OdcmClass)property.Type))
     });
 }
Esempio n. 12
0
 public static Interface ForFetcherUpcastMethods(OdcmEntityClass odcmClass)
 {
     return(new Interface
     {
         Identifier = NamesService.GetFetcherInterfaceName(odcmClass),
         Methods = global::Vipr.Writer.CSharp.Methods.ForFetcherInterfaceUpcasts(odcmClass),
     });
 }
Esempio n. 13
0
 public static Field ForNavigationProperty(OdcmProperty property)
 {
     return(new Field
     {
         Name = NamesService.GetPropertyFieldName(property),
         Type = new Type(NamesService.GetConcreteTypeName(property.Type))
     });
 }
Esempio n. 14
0
 private ConcreteNavigationCollectionProperty(OdcmProperty odcmProperty) : base(odcmProperty)
 {
     FieldName  = NamesService.GetConcreteFieldName(odcmProperty);
     OdcmType   = odcmProperty.Type;
     PrivateSet = true;
     Type       = new Type(NamesService.GetExtensionTypeName("IPagedCollection"),
                           new Type(NamesService.GetConcreteInterfaceName(odcmProperty.Type)));
 }
Esempio n. 15
0
 public CollectionExecuteAsyncMethod(OdcmClass odcmClass)
 {
     Name       = "ExecuteAsync";
     Parameters = Parameter.Empty;
     ReturnType = new Type(new Identifier("global::System.Threading.Tasks", "Task"),
                           new Type(NamesService.GetExtensionTypeName("IPagedCollection"),
                                    new Type(NamesService.GetConcreteInterfaceName(odcmClass))));
 }
Esempio n. 16
0
 protected FetcherNavigationCollectionProperty(OdcmProperty odcmProperty)
     : base(odcmProperty)
 {
     CollectionType = new Type(NamesService.GetCollectionTypeName((OdcmClass)odcmProperty.Type));
     FieldName      = NamesService.GetFetcherCollectionFieldName(odcmProperty);
     InstanceType   = NamesService.GetConcreteTypeName(odcmProperty.Type);
     Type           = new Type(NamesService.GetCollectionInterfaceName((OdcmClass)odcmProperty.Type));
 }
Esempio n. 17
0
 public static Interface ForCountableCollection(OdcmClass odcmClass)
 {
     return(new Interface
     {
         Identifier = NamesService.GetCollectionInterfaceName(odcmClass),
         Methods = global::Vipr.Writer.CSharp.Methods.ForCountableCollectionInterface(odcmClass)
     });
 }
Esempio n. 18
0
 public static Parameter FromProperty(OdcmProperty arg)
 {
     return(new Parameter
     {
         Name = arg.Name.ToLowerCamelCase(),
         Type = new Type(NamesService.GetConcreteTypeName(arg.Type))
     });
 }
Esempio n. 19
0
 public ConcreteExecuteAsyncMethod(OdcmType odcmType)
 {
     EntityIdentifier  = NamesService.GetConcreteInterfaceName(odcmType);
     DefiningInterface = NamesService.GetFetcherInterfaceName(odcmType);
     Name       = "ExecuteAsync";
     Parameters = Parameter.Empty;
     ReturnType = new Type(new Identifier("global::System.Threading.Tasks", "Task"),
                           new Type(NamesService.GetConcreteInterfaceName(odcmType)));
 }
Esempio n. 20
0
 public static IEnumerable <Property> ForEntityContainer(OdcmClass odcmContainer)
 {
     return(Properties.ForEntityContainerInterface(odcmContainer)
            .Concat(new Property[]
     {
         new AutoProperty("Context", new Type(NamesService.GetExtensionTypeName("DataServiceContextWrapper")),
                          privateSet: true)
     }));
 }
Esempio n. 21
0
 public static Class ForCountableCollection(OdcmClass odcmClass)
 {
     return(new Class
     {
         AccessModifier = "internal ",
         Identifier = NamesService.GetCollectionTypeName(odcmClass),
         Methods = global::Vipr.Writer.CSharp.Methods.ForCountableCollectionInterface(odcmClass)
     });
 }
Esempio n. 22
0
 public static Class ForConcreteIFetcherUpcastMethods(OdcmEntityClass odcmClass)
 {
     return(new Class
     {
         AccessModifier = "public ",
         Identifier = NamesService.GetConcreteTypeName(odcmClass),
         Methods = global::Vipr.Writer.CSharp.Methods.ForConcreteUpcasts(odcmClass),
     });
 }
Esempio n. 23
0
 public ContainerNameFromTypeMethod(OdcmClass odcmContainer)
 {
     ClientNamespace = NamesService.GetNamespaceName(odcmContainer.Namespace);
     Visibility      = Visibility.Private;
     Name            = "ResolveNameFromType";
     Parameters      = new[] { new Parameter(new Type(new Identifier("global::System", "Type")), "clientType"), };
     ReturnType      = new Type(new Identifier("System", "String"));
     ServerNamespace = odcmContainer.Namespace.Name;
 }
Esempio n. 24
0
 public ObsoletedProperty(OdcmProperty odcmProperty) : base(odcmProperty)
 {
     Type = odcmProperty.IsCollection
         ? new Type(new Identifier("global::System.Collections.Generic", "IList"),
                    TypeService.GetPropertyType(odcmProperty))
         : TypeService.GetPropertyType(odcmProperty);
     UpdatedName = Name;
     Name        = NamesService.GetModelPropertyName(odcmProperty);
 }
Esempio n. 25
0
 public FetcherExecuteAsyncMethod(OdcmClass odcmClass)
 {
     IsAsync      = true;
     IsOverriding = odcmClass.Base is OdcmClass && !((OdcmClass)odcmClass.Base).IsAbstract;
     Name         = "ExecuteAsync";
     Parameters   = Parameter.Empty;
     ReturnType   = new Type(new Identifier("global::System.Threading.Tasks", "Task"),
                             new Type(NamesService.GetConcreteInterfaceName(odcmClass)));
 }
Esempio n. 26
0
 public static Field ForStructuralProperty(OdcmProperty property)
 {
     return(new Field
     {
         Name = NamesService.GetPropertyFieldName(property),
         Type = property.IsCollection
             ? new Type(NamesService.GetExtensionTypeName("NonEntityTypeCollectionImpl"), new Type(NamesService.GetConcreteTypeName(property.Type)))
             : TypeService.GetPropertyType(property)
     });
 }
Esempio n. 27
0
        public CollectionCountAsyncMethod()
        {
            Name = "CountAsync";

            Parameters = new Parameter[]
            {
            };

            ReturnType = new Type(Identifier.Task, new[] { new Type(NamesService.GetPrimitiveTypeName("Int64")), });
        }
Esempio n. 28
0
        public static IEnumerable <Type> ForConcrete(OdcmClass odcmClass)
        {
            var retVal = new List <Type>
            {
                new Type(NamesService.GetConcreteInterfaceName(odcmClass)),
                new Type(NamesService.GetFetcherInterfaceName(odcmClass))
            };

            return(retVal);
        }
Esempio n. 29
0
 private void Write(FetcherUpcastMethod method)
 {
     WriteSignature(method);
     using (_builder.IndentBraced)
     {
         _("var derivedFetcher = new {0}();", NamesService.GetFetcherTypeName(method.DerivedType));
         _("derivedFetcher.Initialize(this.Context, this.GetPath((string) null));");
         _("return ({0}) derivedFetcher;", NamesService.GetFetcherInterfaceName(method.DerivedType));
     }
 }
Esempio n. 30
0
 public Namespace(OdcmNamespace @namespace, OdcmModel model)
 {
     Name = NamesService.GetNamespaceName(@namespace);
     //Features = @namespace.Enums.SelectMany(global::Vipr.Writer.CSharp.Features.ForOdcmEnum)
     //    .Concat(@namespace.Classes.SelectMany(global::Vipr.Writer.CSharp.Features.ForOdcmClass))
     //    .Concat(@namespace.Classes.SelectMany(c => global::Vipr.Writer.CSharp.Features.ForEntityContainer(c, model)));
     Features = @namespace.Enums.SelectMany(global::Vipr.Writer.CSharp.Features.ForOdcmEnum)
                .Concat(@namespace.Classes.OfType <OdcmComplexClass>().SelectMany(global::Vipr.Writer.CSharp.Features.ForOdcmClass))
                .Concat(@namespace.Classes.OfType <OdcmEntityClass>().SelectMany(global::Vipr.Writer.CSharp.Features.ForOdcmClass))
                .Concat(@namespace.Classes.OfType <OdcmServiceClass>().SelectMany(c => global::Vipr.Writer.CSharp.Features.ForEntityContainer(c, model)));
 }