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), }); }
public EntityCollectionFunctionMethod(OdcmMethod odcmMethod) : base(odcmMethod) { ReturnType = Type.TaskOf(Type.IEnmerableOf(new Type(NamesService.GetPublicTypeName(odcmMethod.ReturnType)))); }
public EntityInstanceFunctionMethod(OdcmMethod odcmMethod) : base(odcmMethod) { InstanceName = NamesService.GetConcreteTypeName(odcmMethod.ReturnType); ReturnType = Type.TaskOf(new Type(NamesService.GetPublicTypeName(odcmMethod.ReturnType))); }
public static Type GetParameterType(OdcmParameter parameter) { return(parameter.IsNullable && IsValueType(parameter.Type) && !(parameter.Type is OdcmEnum) ? GetNullableType(parameter.Type) : new Type(NamesService.GetPublicTypeName(parameter.Type))); }
public static Type GetPropertyType(OdcmProperty property) { return(property.IsNullable && IsValueType(property.Type) && !(property.Type is OdcmEnum) ? GetNullableType(property.Type) : new Type(NamesService.GetPublicTypeName(property.Type))); }
public static Type GetNullableType(OdcmType type) { return(new Type(new Identifier("System", "Nullable"), new Type(NamesService.GetPublicTypeName(type)))); }
private StructuralCollectionProperty(OdcmProperty odcmProperty) : base(odcmProperty) { InstanceType = new Type(NamesService.GetPublicTypeName(odcmProperty.Type)); Type = new Type(new Identifier("System.Collections.Generic", "IList"), InstanceType); }