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;
 }
Esempio n. 2
0
 public Namespace(OdcmNamespace @namespace, OdcmModel model)
 {
     Name = NamesService.GetNamespaceName(@namespace);
     //Features = @namespace.Enums.SelectMany(global::Vipr.Writer.CSharp.Lite.Features.ForOdcmEnum)
     //    .Concat(@namespace.Classes.SelectMany(global::Vipr.Writer.CSharp.Lite.Features.ForOdcmClass))
     //    .Concat(@namespace.Classes.SelectMany(c => global::Vipr.Writer.CSharp.Lite.Features.ForEntityContainer(c, model)));
     Features = @namespace.Enums.SelectMany(global::Vipr.Writer.CSharp.Lite.Features.ForOdcmEnum)
                .Concat(@namespace.Classes.OfType <OdcmComplexClass>().SelectMany(global::Vipr.Writer.CSharp.Lite.Features.ForOdcmClass))
                .Concat(@namespace.Classes.OfType <OdcmEntityClass>().SelectMany(global::Vipr.Writer.CSharp.Lite.Features.ForOdcmClass))
                .Concat(@namespace.Classes.OfType <OdcmServiceClass>().SelectMany(c => global::Vipr.Writer.CSharp.Lite.Features.ForEntityContainer(c, model)));
 }
Esempio n. 3
0
 public static Interface ForEntityContainer(OdcmClass odcmContainer)
 {
     return(new Interface
     {
         Identifier = NamesService.GetEntityContainerInterfaceName(odcmContainer),
         Description = odcmContainer.Description,
         Interfaces = null,
         Methods = global::Vipr.Writer.CSharp.Lite.Methods.ForEntityContainerInterface(odcmContainer),
         Properties = global::Vipr.Writer.CSharp.Lite.Properties.ForEntityContainerInterface(odcmContainer),
         Namespace = NamesService.GetNamespaceName(odcmContainer.Namespace),
     });
 }
Esempio n. 4
0
        public static IEnumerable <Interface> ForConcrete(OdcmClass odcmClass)
        {
            var @interface = new Interface
            {
                Attributes  = global::Vipr.Writer.CSharp.Lite.Attributes.ForConcreteInterface,
                Identifier  = NamesService.GetConcreteInterfaceName(odcmClass),
                Description = odcmClass.Description,
                Namespace   = NamesService.GetNamespaceName(odcmClass.Namespace),
                Properties  = global::Vipr.Writer.CSharp.Lite.Properties.ForConcreteInterface(odcmClass),
                Interfaces  = global::Vipr.Writer.CSharp.Lite.ImplementedInterfaces.ForConcreteInterface(odcmClass)
            };

            return(new List <Interface>()
            {
                @interface
            });
        }
Esempio n. 5
0
        public static IEnumerable <Interface> ForCollection(OdcmEntityClass odcmClass)
        {
            var interfaces = new List <Interface>();

            foreach (var projection in odcmClass.DistinctProjections())
            {
                var @interface = new Interface
                {
                    Attributes = global::Vipr.Writer.CSharp.Lite.Attributes.ForCollectionInterface,
                    Identifier = NamesService.GetCollectionInterfaceName(odcmClass, projection),
                    Namespace  = NamesService.GetNamespaceName(odcmClass.Namespace),
                    Methods    = global::Vipr.Writer.CSharp.Lite.Methods.ForCollectionInterface(odcmClass, projection),
                    Indexers   = IndexerSignature.ForCollectionInterface(odcmClass, projection),
                    Interfaces = new[] { new Type(NamesService.GetExtensionTypeName("IReadOnlyQueryableSetBase"), new Type(NamesService.GetConcreteInterfaceName(odcmClass))) }
                };

                interfaces.Add(@interface);
            }

            return(interfaces);
        }
Esempio n. 6
0
        public static IEnumerable <Interface> ForFetcher(OdcmClass odcmClass)
        {
            var interfaces = new List <Interface>();

            foreach (var projection in odcmClass.DistinctProjections())
            {
                var @interface = new Interface
                {
                    Attributes = global::Vipr.Writer.CSharp.Lite.Attributes.ForFetcherInterface,
                    Identifier = NamesService.GetFetcherInterfaceName(odcmClass, projection),
                    Interfaces = global::Vipr.Writer.CSharp.Lite.ImplementedInterfaces.ForFetcherInterface(odcmClass),
                    Methods    = global::Vipr.Writer.CSharp.Lite.Methods.ForFetcherInterface(odcmClass, projection),
                    Namespace  = NamesService.GetNamespaceName(odcmClass.Namespace),
                    Properties = global::Vipr.Writer.CSharp.Lite.Properties.ForFetcherInterface(odcmClass)
                };

                interfaces.Add(@interface);
            }

            return(interfaces);
        }