Exemplo n.º 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;
 }
 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));
 }
Exemplo n.º 3
0
 public static Field ForNavigationProperty(OdcmProperty property)
 {
     return(new Field
     {
         Name = NamesService.GetPropertyFieldName(property),
         Type = new Type(NamesService.GetConcreteTypeName(property.Type))
     });
 }
 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));
 }
Exemplo n.º 5
0
 public static Parameter FromProperty(OdcmProperty arg)
 {
     return(new Parameter
     {
         Name = arg.Name.ToLowerCamelCase(),
         Type = new Type(NamesService.GetConcreteTypeName(arg.Type))
     });
 }
Exemplo n.º 6
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;
 }
Exemplo n.º 7
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)));
 }
Exemplo n.º 8
0
 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)))
     });
 }
Exemplo n.º 9
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;
 }
Exemplo n.º 10
0
 private void Write(CollectionGetByIdMethod method)
 {
     WriteSignature(method);
     using (_builder.IndentBraced)
     {
         _("return GetFetcherById<{0}, {1}>((i) => {2});", NamesService.GetConcreteTypeName(method.OdcmClass),
           NamesService.GetFetcherTypeName(method.OdcmClass),
           method.ParameterToPropertyMap.ToEquivalenceString("i"));
     }
 }
Exemplo n.º 11
0
 public static Class ForComplex(OdcmClass odcmClass)
 {
     return(new Class
     {
         AbstractModifier = odcmClass.IsAbstract ? "abstract " : string.Empty,
         AccessModifier = "public ",
         Constructors = global::Vipr.Writer.CSharp.Lite.Constructors.ForComplex(odcmClass),
         BaseClass =
             new Type(odcmClass.Base == null
                 ? NamesService.GetExtensionTypeName("ComplexTypeBase")
                 : NamesService.GetPublicTypeName(odcmClass.Base)),
         Description = odcmClass.Description,
         Fields = global::Vipr.Writer.CSharp.Lite.Fields.ForComplex(odcmClass),
         Identifier = NamesService.GetConcreteTypeName(odcmClass),
         Properties = global::Vipr.Writer.CSharp.Lite.Properties.ForComplex(odcmClass),
     });
 }
Exemplo n.º 12
0
        public static IEnumerable <Constructor> ForConcrete(OdcmClass odcmClass)
        {
            var classIdentifier = NamesService.GetConcreteTypeName(odcmClass);

            return(DefaultOnly(odcmClass, classIdentifier));
        }
Exemplo n.º 13
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)
     });
 }
Exemplo n.º 14
0
 public static Parameter FromOdcmParameter(OdcmParameter odcmParameter)
 {
     return(new Parameter
     {
         Name = odcmParameter.Name,
         Description = odcmParameter.Description,
         Type = odcmParameter.IsCollection
             ? new Type(new Identifier("System.Collections.Generic", "ICollection"), new Type(NamesService.GetConcreteTypeName(odcmParameter.Type)))
             : TypeService.GetParameterType(odcmParameter)
     });
 }
Exemplo n.º 15
0
 public EntityInstanceFunctionMethod(OdcmMethod odcmMethod) : base(odcmMethod)
 {
     InstanceName = NamesService.GetConcreteTypeName(odcmMethod.ReturnType);
     ReturnType   = Type.TaskOf(new Type(NamesService.GetPublicTypeName(odcmMethod.ReturnType)));
 }