예제 #1
0
 protected ConcreteNavigationProperty(OdcmProperty odcmProperty) : base(odcmProperty)
 {
     FieldName  = NamesService.GetPropertyFieldName(odcmProperty);
     FieldType  = NamesService.GetConcreteTypeName(odcmProperty.Type);
     Type       = new Type(NamesService.GetConcreteInterfaceName(odcmProperty.Type));
     PrivateSet = true;
 }
예제 #2
0
파일: Attribute.cs 프로젝트: vikyding/Vipr
 public static Attribute ForLowerCaseProperty()
 {
     return(new Attribute
     {
         Type = new Type(NamesService.GetExtensionTypeName("LowerCasePropertyAttribute"))
     });
 }
예제 #3
0
 public static FetcherExpandMethod ForFetcherClass(OdcmClass odcmClass, OdcmProjection projection)
 {
     return(new FetcherExpandMethod(odcmClass, projection)
     {
         DefiningInterface = NamesService.GetFetcherInterfaceName(odcmClass, projection)
     });
 }
예제 #4
0
 public static CollectionGetByIdIndexer ForCollectionClass(OdcmEntityClass odcmClass, OdcmProjection projection)
 {
     return(new CollectionGetByIdIndexer(odcmClass, projection)
     {
         DefiningInterface = NamesService.GetCollectionInterfaceName(odcmClass, projection)
     });
 }
 protected ConcreteNavigationAccessorProperty(OdcmProperty odcmProperty) : base(odcmProperty)
 {
     FieldName    = NamesService.GetPropertyFieldName(odcmProperty);
     InstanceType = NamesService.GetFetcherTypeName(odcmProperty.Type);
     FieldType    = NamesService.GetConcreteTypeName(odcmProperty.Type);
     Type         = new Type(NamesService.GetConcreteTypeName(odcmProperty.Type));
 }
예제 #6
0
 public static CollectionGetByIdMethod ForCollectionClass(OdcmClass odcmClass, OdcmProjection projection = null)
 {
     return(new CollectionGetByIdMethod(odcmClass, projection)
     {
         DefiningInterface = NamesService.GetCollectionInterfaceName(odcmClass, projection)
     });
 }
예제 #7
0
 public static FetcherNavigationProperty ForConcrete(OdcmProperty odcmProperty)
 {
     return(new FetcherNavigationProperty(odcmProperty)
     {
         DefiningInterface = NamesService.GetFetcherInterfaceName(odcmProperty.Class)
     });
 }
예제 #8
0
 protected FetcherNavigationProperty(OdcmProperty odcmProperty) : base(odcmProperty)
 {
     FieldName    = NamesService.GetFetcherFieldName(odcmProperty);
     InstanceType = NamesService.GetFetcherTypeName(odcmProperty.Projection.Type);
     PrivateSet   = true;
     Type         = new Type(NamesService.GetFetcherInterfaceName(odcmProperty.Projection.Type, odcmProperty.Projection));
 }
예제 #9
0
 public new static ConcreteNavigationProperty ForConcrete(OdcmProperty odcmProperty)
 {
     return(new ConcreteNavigationCollectionProperty(odcmProperty)
     {
         DefiningInterface = NamesService.GetConcreteInterfaceName(odcmProperty.Class),
     });
 }
예제 #10
0
 private void Write(ConcreteUpcastMethod method)
 {
     WriteSignature(method);
     using (_builder.IndentBraced)
     {
         _("return ({0}) this;", NamesService.GetFetcherInterfaceName(method.DerivedType));
     }
 }
예제 #11
0
 public CollectionGetByIdMethod(OdcmClass odcmClass, OdcmProjection projection = null)
 {
     Name = "GetById";
     ParameterToPropertyMap = ((OdcmEntityClass)odcmClass).Key.ToDictionary(Parameter.FromProperty, p => p);
     Parameters             = global::Vipr.Writer.CSharp.Lite.Parameters.GetKeyParameters(odcmClass);
     ReturnType             = new Type(NamesService.GetFetcherInterfaceName(odcmClass, projection));
     OdcmClass = odcmClass;
 }
예제 #12
0
 public static Parameter FromProperty(OdcmProperty arg)
 {
     return(new Parameter
     {
         Name = arg.Name.ToLowerCamelCase(),
         Type = new Type(NamesService.GetConcreteTypeName(arg.Type))
     });
 }
예제 #13
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));
     IsCollection = odcmProperty.IsCollection;
 }
예제 #14
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)));
 }
예제 #15
0
 private ConcreteNavigationCollectionProperty(OdcmProperty odcmProperty) : base(odcmProperty)
 {
     FieldName  = NamesService.GetConcreteFieldName(odcmProperty);
     OdcmType   = odcmProperty.Type;
     PrivateSet = true;
     Type       = new Type(new Identifier("global::System.Collections.Generic", "IList"),
                           new Type(NamesService.GetConcreteInterfaceName(odcmProperty.Type)));
 }
예제 #16
0
파일: Interface.cs 프로젝트: vikyding/Vipr
 public static Interface ForFetcherUpcastMethods(OdcmEntityClass odcmClass)
 {
     return(new Interface
     {
         Identifier = NamesService.GetFetcherInterfaceName(odcmClass),
         Methods = global::Vipr.Writer.CSharp.Lite.Methods.ForFetcherInterfaceUpcasts(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));
 }
예제 #18
0
파일: Field.cs 프로젝트: vikyding/Vipr
 public static Field ForNavigationProperty(OdcmProperty property)
 {
     return(new Field
     {
         Name = NamesService.GetPropertyFieldName(property),
         Type = new Type(NamesService.GetConcreteTypeName(property.Type))
     });
 }
예제 #19
0
파일: Interface.cs 프로젝트: vikyding/Vipr
 public static Interface ForCountableCollection(OdcmClass odcmClass)
 {
     return(new Interface
     {
         Identifier = NamesService.GetCollectionInterfaceName(odcmClass),
         Methods = global::Vipr.Writer.CSharp.Lite.Methods.ForCountableCollectionInterface(odcmClass)
     });
 }
예제 #20
0
파일: Field.cs 프로젝트: vikyding/Vipr
 public static Field ForFetcherNavigationCollectionProperty(OdcmProperty property)
 {
     return(new Field
     {
         Name = NamesService.GetFetcherCollectionFieldName(property),
         Type = new Type(NamesService.GetCollectionTypeName((OdcmClass)property.Type))
     });
 }
예제 #21
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))));
 }
예제 #22
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);
 }
예제 #23
0
 public ContainerTypeFromNameMethod(OdcmClass odcmContainer)
 {
     ClientNamespace = NamesService.GetNamespaceName(odcmContainer.Namespace);
     Visibility      = Visibility.Private;
     Name            = "ResolveTypeFromName";
     Parameters      = new[] { new Parameter(new Type(new Identifier("System", "String")), "typeName"), };
     ReturnType      = new Type(new Identifier("global::System", "Type"));
     ServerNamespace = odcmContainer.Namespace.Name;
 }
예제 #24
0
파일: Field.cs 프로젝트: vikyding/Vipr
 public static Field ForConcreteNavigationCollectionProperty(OdcmProperty property)
 {
     return(new Field
     {
         Name = NamesService.GetConcreteFieldName(property),
         Type = new Type(new Identifier("global::System.Collections.Generic", "List"),
                         new Type(NamesService.GetConcreteTypeName(property.Type)))
     });
 }
예제 #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)));
 }
예제 #26
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)));
 }
예제 #27
0
 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)));
     PrivateSet = true;
 }
예제 #28
0
파일: Class.cs 프로젝트: vikyding/Vipr
 public static Class ForCountableCollection(OdcmClass odcmClass)
 {
     return(new Class
     {
         AccessModifier = "internal ",
         Identifier = NamesService.GetCollectionTypeName(odcmClass),
         Methods = global::Vipr.Writer.CSharp.Lite.Methods.ForCountableCollectionInterface(odcmClass)
     });
 }
예제 #29
0
파일: Class.cs 프로젝트: vikyding/Vipr
 public static Class ForFetcherUpcastMethods(OdcmEntityClass odcmClass)
 {
     return(new Class
     {
         AccessModifier = "internal ",
         Identifier = NamesService.GetFetcherTypeName(odcmClass),
         Methods = global::Vipr.Writer.CSharp.Lite.Methods.ForFetcherUpcasts(odcmClass),
     });
 }
예제 #30
0
파일: Properties.cs 프로젝트: vikyding/Vipr
 public static IEnumerable <Property> ForEntityContainer(OdcmClass odcmContainer)
 {
     return(Properties.ForEntityContainerInterface(odcmContainer)
            .Concat(new Property[]
     {
         new AutoProperty("Context", new Type(NamesService.GetExtensionTypeName("DataServiceContextWrapper")),
                          privateSet: true)
     }));
 }