public static Attribute ForLowerCaseProperty() { return(new Attribute { Type = new Type(NamesService.GetExtensionTypeName("LowerCasePropertyAttribute")) }); }
public new static FetcherNavigationProperty ForConcrete(OdcmProperty odcmProperty) { return(new FetcherNavigationCollectionProperty(odcmProperty) { DefiningInterface = NamesService.GetFetcherInterfaceName(odcmProperty.Class), }); }
public static FetcherExpandMethod ForConcrete(OdcmClass odcmClass) { return(new FetcherExpandMethod(odcmClass) { DefiningInterface = NamesService.GetFetcherInterfaceName(odcmClass) }); }
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 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), }); }
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))); }
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))); }
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 ForFetcherNavigationCollectionProperty(OdcmProperty property) { return(new Field { Name = NamesService.GetFetcherCollectionFieldName(property), Type = new Type(NamesService.GetCollectionTypeName((OdcmClass)property.Type)) }); }
public static Interface ForFetcherUpcastMethods(OdcmEntityClass odcmClass) { return(new Interface { Identifier = NamesService.GetFetcherInterfaceName(odcmClass), Methods = global::Vipr.Writer.CSharp.Methods.ForFetcherInterfaceUpcasts(odcmClass), }); }
public static Field ForNavigationProperty(OdcmProperty property) { return(new Field { Name = NamesService.GetPropertyFieldName(property), Type = new Type(NamesService.GetConcreteTypeName(property.Type)) }); }
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))); }
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)))); }
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 Interface ForCountableCollection(OdcmClass odcmClass) { return(new Interface { Identifier = NamesService.GetCollectionInterfaceName(odcmClass), Methods = global::Vipr.Writer.CSharp.Methods.ForCountableCollectionInterface(odcmClass) }); }
public static Parameter FromProperty(OdcmProperty arg) { return(new Parameter { Name = arg.Name.ToLowerCamelCase(), Type = new Type(NamesService.GetConcreteTypeName(arg.Type)) }); }
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))); }
public static IEnumerable <Property> ForEntityContainer(OdcmClass odcmContainer) { return(Properties.ForEntityContainerInterface(odcmContainer) .Concat(new Property[] { new AutoProperty("Context", new Type(NamesService.GetExtensionTypeName("DataServiceContextWrapper")), privateSet: true) })); }
public static Class ForCountableCollection(OdcmClass odcmClass) { return(new Class { AccessModifier = "internal ", Identifier = NamesService.GetCollectionTypeName(odcmClass), Methods = global::Vipr.Writer.CSharp.Methods.ForCountableCollectionInterface(odcmClass) }); }
public static Class ForConcreteIFetcherUpcastMethods(OdcmEntityClass odcmClass) { return(new Class { AccessModifier = "public ", Identifier = NamesService.GetConcreteTypeName(odcmClass), Methods = global::Vipr.Writer.CSharp.Methods.ForConcreteUpcasts(odcmClass), }); }
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; }
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); }
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))); }
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 CollectionCountAsyncMethod() { Name = "CountAsync"; Parameters = new Parameter[] { }; ReturnType = new Type(Identifier.Task, new[] { new Type(NamesService.GetPrimitiveTypeName("Int64")), }); }
public static IEnumerable <Type> ForConcrete(OdcmClass odcmClass) { var retVal = new List <Type> { new Type(NamesService.GetConcreteInterfaceName(odcmClass)), new Type(NamesService.GetFetcherInterfaceName(odcmClass)) }; return(retVal); }
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)); } }
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))); }