Example #1
0
 public static Parameter FromOdcmParameter(OdcmParameter odcmParameter)
 {
     return(new Parameter
     {
         Name = odcmParameter.Name,
         Type = odcmParameter.IsCollection
             ? new Type(new Identifier("System.Collections.Generic", "ICollection"), new Type(NamesService.GetConcreteTypeName(odcmParameter.Type)))
             : TypeService.GetParameterType(odcmParameter)
     });
 }
Example #2
0
 public static Field ForStructuralProperty(OdcmProperty property)
 {
     return(new Field
     {
         Name = NamesService.GetPropertyFieldName(property),
         Type = property.IsCollection
             ? new Type(NamesService.GetExtensionTypeName("NonEntityTypeCollectionImpl"), new Type(NamesService.GetConcreteTypeName(property.Type)))
             : TypeService.GetPropertyType(property)
     });
 }
Example #3
0
        public CSharpWriter(OdcmModel model, IConfigurationProvider configurationProvider)
        {
            Model = model;

            ConfigurationService.Initialize(configurationProvider);

            TypeService.Initialize(Model);

            if (model.ServiceType == ServiceType.ODataV4)
            {
                _dependencies.Add("global::Microsoft.OData.Client");
                _dependencies.Add("global::Microsoft.OData.Edm");
                _dependencies.Add("System");
                _dependencies.Add("System.Collections.Generic");
                _dependencies.Add("System.ComponentModel");
                _dependencies.Add("System.Linq");
                _dependencies.Add("System.Reflection");
            }
        }
 protected StructuralProperty(OdcmProperty odcmProperty) : base(odcmProperty)
 {
     FieldName = NamesService.GetPropertyFieldName(odcmProperty);
     Type      = TypeService.GetPropertyType(odcmProperty);
 }