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)); }
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)); }
public static Parameter FromProperty(OdcmProperty arg) { return(new Parameter { Name = arg.Name.ToLowerCamelCase(), Type = new Type(NamesService.GetConcreteTypeName(arg.Type)) }); }
public static Field ForNavigationProperty(OdcmProperty property) { return(new Field { Name = NamesService.GetPropertyFieldName(property), Type = new Type(NamesService.GetConcreteTypeName(property.Type)) }); }
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))); }
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))); }
public static Class ForConcreteIFetcherUpcastMethods(OdcmEntityClass odcmClass) { return(new Class { AccessModifier = "public ", Identifier = NamesService.GetConcreteTypeName(odcmClass), Methods = global::Vipr.Writer.CSharp.Methods.ForConcreteUpcasts(odcmClass), }); }
private void Write(CollectionGetByIdIndexer indexer) { WriteSignature(indexer); using (_builder.IndentBraced) { _("get"); using (_builder.IndentBraced) { _("var path = GetPath<{0}>((i) => {1});", NamesService.GetConcreteTypeName(indexer.OdcmClass), indexer.ParameterToPropertyMap.ToEquivalenceString("i")); _("var fetcher = new {0}();", NamesService.GetFetcherTypeName(indexer.OdcmClass)); _("fetcher.Initialize(Context, path);"); _(""); _("return fetcher;"); } } }
public static Class ForComplex(OdcmClass odcmClass) { return(new Class { AbstractModifier = odcmClass.IsAbstract ? "abstract " : string.Empty, AccessModifier = "public ", Constructors = global::Vipr.Writer.CSharp.Constructors.ForComplex(odcmClass), BaseClass = new Type(odcmClass.Base == null ? NamesService.GetExtensionTypeName("ComplexTypeBase") : NamesService.GetPublicTypeName(odcmClass.Base)), Description = odcmClass.Description, Fields = global::Vipr.Writer.CSharp.Fields.ForComplex(odcmClass), Identifier = NamesService.GetConcreteTypeName(odcmClass), Properties = global::Vipr.Writer.CSharp.Properties.ForComplex(odcmClass), }); }
private void Write(ConcreteNavigationCollectionProperty property) { WriteDeclaration(property); using (_builder.IndentBraced) { _("get"); using (_builder.IndentBraced) { _("return new {0}<{1}, {2}>(Context, ({3}<{2}>) {4});", NamesService.GetExtensionTypeName("PagedCollection"), NamesService.GetConcreteInterfaceName(property.OdcmType), NamesService.GetConcreteTypeName(property.OdcmType), "DataServiceCollection", property.Name); } } }
public static Class ForConcrete(OdcmEntityClass odcmClass) { return(new Class { AbstractModifier = odcmClass.IsAbstract ? "abstract " : string.Empty, AccessModifier = "public ", Attributes = global::Vipr.Writer.CSharp.Attributes.ForConcrete(odcmClass), BaseClass = new Type(odcmClass.Base == null ? NamesService.GetExtensionTypeName("EntityBase") : NamesService.GetConcreteTypeName(odcmClass.Base)), Constructors = global::Vipr.Writer.CSharp.Constructors.ForConcrete(odcmClass), Description = odcmClass.Description, Fields = global::Vipr.Writer.CSharp.Fields.ForConcrete(odcmClass), Identifier = NamesService.GetConcreteTypeName(odcmClass), Interfaces = global::Vipr.Writer.CSharp.ImplementedInterfaces.ForConcrete(odcmClass), Methods = global::Vipr.Writer.CSharp.Methods.ForConcrete(odcmClass), Properties = global::Vipr.Writer.CSharp.Properties.ForConcrete(odcmClass) }); }
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) }); }
public static IEnumerable <Constructor> ForConcrete(OdcmClass odcmClass) { var classIdentifier = NamesService.GetConcreteTypeName(odcmClass); return(DefaultOnly(odcmClass, classIdentifier)); }
protected ConcreteNavigationProperty(OdcmProperty odcmProperty) : base(odcmProperty) { FieldName = NamesService.GetPropertyFieldName(odcmProperty); FieldType = NamesService.GetConcreteTypeName(odcmProperty.Type); Type = new Type(NamesService.GetConcreteInterfaceName(odcmProperty.Type)); }
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))) }); }
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) }); }
public EntityInstanceFunctionMethod(OdcmMethod odcmMethod) : base(odcmMethod) { InstanceName = NamesService.GetConcreteTypeName(odcmMethod.ReturnType); ReturnType = Type.TaskOf(new Type(NamesService.GetPublicTypeName(odcmMethod.ReturnType))); }
protected ConcreteNavigationAccessorProperty(OdcmProperty odcmProperty) : base(odcmProperty) { FieldName = NamesService.GetPropertyFieldName(odcmProperty); InstanceType = NamesService.GetFetcherTypeName(odcmProperty.Type); Type = new Type(NamesService.GetConcreteTypeName(odcmProperty.Type)); }