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)); }
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)); }
public static Class ForFetcherUpcastMethods(OdcmEntityClass odcmClass) { return(new Class { AccessModifier = "internal ", Identifier = NamesService.GetFetcherTypeName(odcmClass), Methods = global::Vipr.Writer.CSharp.Lite.Methods.ForFetcherUpcasts(odcmClass), }); }
public static Field ForNavigationFetcherProperty(OdcmProperty property) { return(new Field { Name = NamesService.GetFetcherFieldName(property), Type = property.IsCollection ? new Type(NamesService.GetCollectionTypeName((OdcmClass)property.Type)) : new Type(NamesService.GetFetcherTypeName(property.Type)) }); }
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)); } }
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")); } }
private void Write(FetcherExpandMethod method) { WriteSignature(method); using (_builder.IndentBraced) { _("return ({0}) new {1}()", method.ReturnType.TypeIdentifier, NamesService.GetFetcherTypeName(method.OdcmClass)); using (_builder.IndentBraced) { _("_query = this.EnsureQuery().Expand<TTarget>(navigationPropertyAccessor)"); } _(";"); } }
public static Class ForFetcher(OdcmClass odcmClass) { return(new Class { AccessModifier = "internal ", BaseClass = new Type(odcmClass.Base == null ? NamesService.GetExtensionTypeName("RestShallowObjectFetcher") : NamesService.GetFetcherTypeName(odcmClass.Base)), Constructors = global::Vipr.Writer.CSharp.Lite.Constructors.ForFetcher(odcmClass), Fields = global::Vipr.Writer.CSharp.Lite.Fields.ForFetcher(odcmClass), Identifier = NamesService.GetFetcherTypeName(odcmClass), Interfaces = global::Vipr.Writer.CSharp.Lite.ImplementedInterfaces.ForFetcherClass(odcmClass), Methods = global::Vipr.Writer.CSharp.Lite.Methods.ForFetcherClass(odcmClass), Properties = global::Vipr.Writer.CSharp.Lite.Properties.ForFetcher(odcmClass), }); }
public static IEnumerable <Constructor> ForFetcher(OdcmClass odcmClass) { var classIdentifier = NamesService.GetFetcherTypeName(odcmClass); return(DefaultOnly(odcmClass, classIdentifier)); }