public void Write(OdcmMethod odcmMethod) { var returnType = NamesService.GetPublicTypeName(odcmMethod.ReturnType); var parameters = string.Join(", ", (from i in odcmMethod.Parameters select NamesService.GetPublicTypeName(i.Type, i.IsCollection) + " " + i.Name)); }
public EnsureQueryMethod(OdcmClass odcmClass) { IsPublic = false; Name = "EnsureQuery"; FetchedType = NamesService.GetPublicTypeName(odcmClass); QueryableSetType = new Type(NamesService.GetExtensionTypeName("ReadOnlyQueryableSet"), new Type(NamesService.GetPublicTypeName(odcmClass))); ReturnType = new Type(NamesService.GetExtensionTypeName("IReadOnlyQueryableSet"), new Type(NamesService.GetConcreteInterfaceName(odcmClass))); }
public static Class ForComplex(OdcmClass odcmClass) { return(new Class { AbstractModifier = odcmClass.IsAbstract ? "abstract " : string.Empty, AccessModifier = "public ", Constructors = global::CSharpWriter.Constructors.ForComplex(odcmClass), BaseClass = new Type(odcmClass.Base == null ? NamesService.GetExtensionTypeName("ComplexTypeBase") : NamesService.GetPublicTypeName(odcmClass.Base)), Fields = global::CSharpWriter.Fields.ForComplex(odcmClass), Identifier = NamesService.GetConcreteTypeName(odcmClass), Properties = global::CSharpWriter.Properties.ForComplex(odcmClass), }); }
public EntityFunctionMethod(OdcmMethod odcmMethod) { InstanceName = NamesService.GetConcreteTypeName(odcmMethod.ReturnType); IsAsync = true; ModelName = odcmMethod.Name; Name = odcmMethod.Name + "Async"; Parameters = odcmMethod.Parameters.Select(Parameter.FromOdcmParameter); ReturnType = new Type(new Identifier("System.Threading.Tasks", "Task"), 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)); ModelName = odcmProperty.Name; Type = new Type(new Identifier("System.Collections.Generic", "IList"), InstanceType); }
public void Write(OdcmField odcmField) { _("private {0} {1};", NamesService.GetPublicTypeName(odcmField.Type).FullName, odcmField.Name); }