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 Field(string name, Type type, string defaultValue = "", bool isConstant = false, bool isStatic = false) { Name = name; Type = type; IsConstant = isConstant; IsStatic = isStatic; DefaultValue = defaultValue; }
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)); }
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))); }
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 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)))); }
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; }
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 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 CollectionCountAsyncMethod() { Name = "CountAsync"; Parameters = new Parameter[] { }; ReturnType = new Type(Identifier.Task, new[] { new Type(NamesService.GetPrimitiveTypeName("Int64")), }); }
public CollectionGetByIdIndexer(OdcmEntityClass odcmClass) { ParameterToPropertyMap = odcmClass.Key.ToDictionary(Parameter.FromProperty, p => p); Parameters = global::Vipr.Writer.CSharp.Parameters.GetKeyParameters(odcmClass); ReturnType = new Type(NamesService.GetFetcherInterfaceName(odcmClass)); OdcmClass = odcmClass; IsSettable = false; IsGettable = true; }
public AddAsyncMethod(OdcmClass odcmClass) { Name = "Add" + odcmClass.Name + "Async"; Parameters = new[] { new Parameter(new Type(NamesService.GetConcreteInterfaceName(odcmClass)), "item"), new Parameter(new Type(NamesService.GetPrimitiveTypeName("Boolean")), "deferSaveChanges", "false") }; ReturnType = new Type(Identifier.Task); }
private FetcherExpandMethod(OdcmClass odcmClass) { Visibility = Visibility.Public; Name = "Expand"; GenericParameters = new[] { "TTarget" }; Parameters = new[] { new Parameter(new Type(new Identifier("System.Linq.Expressions", "Expression"), new Type(new Identifier("System", "Func"), new Type(NamesService.GetConcreteInterfaceName(odcmClass)), new Type(new Identifier(null, "TTarget")))), "navigationPropertyAccessor"), }; ReturnType = new Type(NamesService.GetFetcherInterfaceName(odcmClass)); OdcmClass = odcmClass; }
public AddAsyncMediaMethod(OdcmClass odcmClass) { Name = "Add" + odcmClass.Name + "Async"; Parameters = new[] { new Parameter(new Type(NamesService.GetConcreteInterfaceName(odcmClass)), "item"), new Parameter(new Type(NamesService.GetPrimitiveTypeName("IStream")), "stream"), new Parameter(new Type(NamesService.GetPrimitiveTypeName("String")), "contentType"), new Parameter(new Type(NamesService.GetPrimitiveTypeName("Boolean")), "deferSaveChanges", "false"), new Parameter(new Type(NamesService.GetPrimitiveTypeName("Boolean")), "closeStream", "false") }; ReturnType = new Type(Identifier.Task); Visibility = ConfigurationService.Settings.MediaEntityAddAsyncVisibility; }
public Parameter(Type type, string name, string defaultValue = null) { Type = type; Name = name; DefaultValue = defaultValue; }
public EntityVoidMethod(OdcmMethod odcmMethod) : base(odcmMethod) { ReturnType = new Type(new Identifier("System.Threading.Tasks", "Task")); }
private StructuralCollectionProperty(OdcmProperty odcmProperty) : base(odcmProperty) { InstanceType = new Type(NamesService.GetPublicTypeName(odcmProperty.Type)); Type = new Type(new Identifier("System.Collections.Generic", "IList"), InstanceType); }
public FetcherUpcastMethod(OdcmType baseType, OdcmType derivedType) : base(baseType, derivedType) { Name = "To" + derivedType.Name; Parameters = global::Vipr.Writer.CSharp.Parameters.Empty; ReturnType = new Type(NamesService.GetFetcherInterfaceName(derivedType)); }
public CollectionGetByIdMethod(OdcmClass odcmClass) { Name = "GetById"; Parameters = global::Vipr.Writer.CSharp.Parameters.GetKeyParameters(odcmClass); ReturnType = new Type(NamesService.GetFetcherInterfaceName(odcmClass)); }
protected ConcreteNavigationProperty(OdcmProperty odcmProperty) : base(odcmProperty) { FieldName = NamesService.GetPropertyFieldName(odcmProperty); FieldType = NamesService.GetConcreteTypeName(odcmProperty.Type); Type = new Type(NamesService.GetConcreteInterfaceName(odcmProperty.Type)); }
protected ConcreteNavigationAccessorProperty(OdcmProperty odcmProperty) : base(odcmProperty) { FieldName = NamesService.GetPropertyFieldName(odcmProperty); InstanceType = NamesService.GetFetcherTypeName(odcmProperty.Type); Type = new Type(NamesService.GetConcreteTypeName(odcmProperty.Type)); }