コード例 #1
0
        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));
        }
コード例 #2
0
 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)));
 }
コード例 #3
0
 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),
     });
 }
コード例 #4
0
 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)));
 }
コード例 #5
0
 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)));
 }
コード例 #6
0
 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)));
 }
コード例 #7
0
 public static Type GetNullableType(OdcmType type)
 {
     return(new Type(new Identifier("System", "Nullable"), new Type(NamesService.GetPublicTypeName(type))));
 }
コード例 #8
0
 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);
 }
コード例 #9
0
 public void Write(OdcmField odcmField)
 {
     _("private {0} {1};", NamesService.GetPublicTypeName(odcmField.Type).FullName, odcmField.Name);
 }