示例#1
0
        public UnitOfWorkGen(ContextInfo dt)
        {
            Data = dt;
            Directive.Add(
                "Microsoft.EntityFrameworkCore.Storage",
                "Microsoft.EntityFrameworkCore",
                Data.ProjectName + ".Global", Data.ProjectName + ".Models.Repositories",
                Data.ProjectName + ".Models.Domains",
                Data.ContextNamespace);
            ResolveMapping["context"] = Data.ContextName;

            if (dt.DIContainer == DIContainer.TContainer)
            {
                Directive.Add("TNT.Core.IoC.Wrapper", "TNT.Core.IoC.Container");
                Container = "ITContainer";
            }
            else
            {
                Container = "IServiceProvider";
                Directive.Add("Microsoft.Extensions.DependencyInjection");
            }

            //GENERATE
            GenerateNamespace();
            GenerateIUnitOfWork();
            GenerateUnitOfWork();
        }
示例#2
0
        public GlobalGen(ContextInfo dt)
        {
            Data = dt;
            Directive.Add("AutoMapper",
                          "Microsoft.EntityFrameworkCore",
                          Data.ContextNamespace,
                          Data.ProjectName + ".Models",
                          Data.ProjectName + ".Models.Repositories",
                          Data.ProjectName + ".ServiceModels");
            if (Data.DIContainer == DIContainer.TContainer)
            {
                Directive.Add("TNT.Core.IoC.Container");
            }
            else
            {
                Directive.Add("Microsoft.Extensions.DependencyInjection");
            }

            //GENERATE
            GenerateNamespace();
            GenerateGlobal();
            //GenerateHttpApp();
            GenerateMapperConfig();
            GenerateInitMapper();
            GenerateInitDI();
        }
 public EntityGen(DataInfo dt)
 {
     Data = dt;
     Directive.Add(dt.ProjectName + ".Global");
     //GENERATE
     GenerateNamespace();
     GenerateIEntity();
     GenerateBaseEntity();
 }
示例#4
0
 public BaseVMGen(ContextInfo dt)
 {
     Data = dt;
     Directive.Add(dt.ProjectName + ".Global",
                   "System.Reflection");
     //GENERATE
     GenerateNamespace();
     GenerateIBaseVM();
     GenerateBaseVM();
     GenerateBaseUpdateVM();
 }
        public UtilitiesGen(DataInfo dt)
        {
            Data = dt;
            Directive.Add(
                Data.ProjectName + ".Models",
                Data.ProjectName + ".ViewModels");

            //GENERATE
            GenerateNamespace();
            GenerateGeneralExtension();
        }
示例#6
0
        public EntityExtensionGen(EntityInfo eInfo)
        {
            EInfo = eInfo;
            ResolveMapping.Add("entity", EInfo.EntityName);
            ResolveMapping.Add("entityPK", EInfo.PKClass);
            ResolveMapping.Add("entityVM", EInfo.VMClass);

            Directive.Add(EInfo.Data.ProjectName + ".ViewModels",
                          EInfo.Data.ProjectName + ".Global");
            //GENERATE
            GenerateNamespace();
            GenerateEntityPKClass();
            GenerateEntityExtension();
        }
 public ServiceGen(DataInfo dt)
 {
     Data = dt;
     Directive.Add("System.Linq.Expressions",
                   dt.ProjectName + ".Utilities",
                   dt.ProjectName + ".Managers",
                   dt.ProjectName + ".Models.Repositories",
                   dt.ProjectName + ".Global", "TNT.IoContainer.Wrapper", "TNT.IoContainer.Container");
     //GENERATE
     GenerateNamespace();
     GenerateIBaseService();
     GenerateBaseService();
     GenerateBaseServiceBody();
 }
示例#8
0
        public RepositoryGen(ContextInfo dt)
        {
            Data = dt;
            Directive.Add("System.Linq.Expressions", dt.ContextNamespace
                          , "Microsoft.EntityFrameworkCore"
                          , "Microsoft.EntityFrameworkCore.ChangeTracking");
            ResolveMapping["context"] = dt.ContextName;

            //GENERATE
            GenerateNamespace();
            GenerateIBaseRepository();
            GenerateBaseRepository();
            GenerateBaseRepositoryBody();
        }
        public RepositoryGen(DataInfo dt)
        {
            Data = dt;
            Directive.Add("System.Linq.Expressions", dt.ProjectName + ".Models"
                          , dt.ProjectName + ".Managers"
                          , "TNT.IoContainer.Container"
                          , "System.Data.Entity.Infrastructure");
            ResolveMapping.Add("context", dt.ContextName);

            //GENERATE
            GenerateNamespace();
            GenerateIBaseRepository();
            GenerateBaseRepository();
            GenerateBaseRepositoryBody();
        }
示例#10
0
        public UnitOfWorkGen(DataInfo dt)
        {
            Data = dt;
            Directive.Add("TNT.IoContainer.Wrapper", "TNT.IoContainer.Container",
                          "System.Web",
                          "System.Data.Entity",
                          Data.ProjectName + ".Global", Data.ProjectName + ".Models.Services",
                          Data.ProjectName + ".Models");
            ResolveMapping.Add("context", Data.ContextName);

            //GENERATE
            GenerateNamespace();
            GenerateIUnitOfWork();
            GenerateUnitOfWork();
        }
示例#11
0
        public VMGen(EntityInfo eInfo, string[] jsonIgnoreProps, string[] exceptProps, JsonPropertyFormatEnum style)
        {
            Style = style;
            EInfo = eInfo;
            ResolveMapping.Add("entity", EInfo.EntityName);
            ResolveMapping.Add("entityVM", EInfo.VMClass);
            JsonIgnoreProps = jsonIgnoreProps;
            ExceptProps     = exceptProps;
            Directive.Add(EInfo.Data.ProjectName + ".Global", EInfo.Data.ProjectName + ".Models",
                          "Newtonsoft.Json");

            //GENERATE
            GenerateNamespace();
            GenerateVMClass();
            GenerateVMClassBody();
        }
示例#12
0
        public EntityRepositoryGen(EntityInfo eInfo)
        {
            EInfo = eInfo;
            Directive.Add(EInfo.Data.ContextNamespace,
                          "System.Linq.Expressions", "Microsoft.EntityFrameworkCore");

            ResolveMapping["entity"]   = EInfo.EntityName;
            ResolveMapping["entityPK"] = EInfo.PKClass;
            ResolveMapping["entityVM"] = EInfo.VMClass;
            ResolveMapping["context"]  = EInfo.Data.ContextName;

            //GENERATE
            GenerateNamespace();
            GenerateIEntityRepository();
            GenerateEntityRepository();
            GenerateEntityRepositoryBody();
        }
示例#13
0
        public BaseDomainGen(ContextInfo dt)
        {
            Data = dt;
            Directive.Add(
                Data.ProjectName + ".Models.Repositories",
                Data.ProjectName + ".ServiceModels",
                Data.ContextNamespace,
                Data.ProjectName + ".Global",
                "Microsoft.EntityFrameworkCore",
                "System.Linq.Expressions");
            ResolveMapping["context"] = dt.ContextName;

            //GENERATE
            GenerateNamespace();
            GenerateBaseDomain();
            GenerateBaseDomainBody();
        }
示例#14
0
        public EntityRepositoryGen(EntityInfo eInfo)
        {
            EInfo = eInfo;
            Directive.Add(EInfo.Data.ProjectName + ".Models",
                          EInfo.Data.ProjectName + ".Managers",
                          "System.Linq.Expressions", "System.Data.Entity");
            ResolveMapping.Add("entity", EInfo.EntityName);
            ResolveMapping.Add("entities", EInfo.PluralEntityName);
            ResolveMapping.Add("entityPK", EInfo.PKClass);
            ResolveMapping.Add("context", EInfo.Data.ContextName);

            //GENERATE
            GenerateNamespace();
            GenerateIEntityRepository();
            GenerateEntityRepository();
            GenerateEntityRepositoryBody();
        }
示例#15
0
        public EntityExtensionGen(EntityInfo eInfo)
        {
            EInfo = eInfo;

            ResolveMapping["entity"]   = EInfo.EntityName;
            ResolveMapping["entityPK"] = EInfo.PKClass;
            ResolveMapping["entityVM"] = EInfo.VMClass;

            Directive.Add(EInfo.Data.ProjectName + ".ServiceModels",
                          EInfo.Data.ContextNamespace,
                          EInfo.Data.ProjectName + ".Global");
            //GENERATE
            GenerateNamespace();
            GenerateEntityPKClass();
            GenerateBaseEntityExtension();
            GenerateExtensionNamespace();
            GenerateEntityExtension();
        }
示例#16
0
        public BaseDomainGen(DataInfo dt)
        {
            Data = dt;
            Directive.Add(
                Data.ProjectName + ".Models.Services",
                Data.ProjectName + ".ViewModels",
                Data.ProjectName + ".Managers",
                Data.ProjectName + ".Utilities",
                Data.ProjectName + ".Models",
                Data.ProjectName + ".Global",
                "System.Linq.Expressions",
                "TNT.IoContainer.Wrapper");

            //GENERATE
            GenerateNamespace();
            //GenerateIBaseDomain();
            GenerateBaseDomain();
            GenerateBaseDomainBody();
        }
        public EntityDomainGen(EntityInfo eInfo)
        {
            EInfo = eInfo;
            var dt = EInfo.Data;

            Directive.Add(
                dt.ProjectName + ".ViewModels", dt.ProjectName + ".Models.Services",
                dt.ProjectName + ".Managers",
                dt.ProjectName + ".Models");
            ResolveMapping.Add("service", "I" + EInfo.EntityName + "Service");
            ResolveMapping.Add("context", EInfo.Data.ContextName);
            ResolveMapping.Add("entity", EInfo.EntityName);
            ResolveMapping.Add("entityVM", EInfo.VMClass);
            ResolveMapping.Add("entityPK", EInfo.PKClass);

            //GENERATE
            GenerateNamespace();
            GenerateEntityDomain();
        }
        public EntityServiceGen(EntityInfo eInfo)
        {
            EInfo = eInfo;
            var dt = EInfo.Data;

            Directive.Add("System.Linq.Expressions",
                          dt.ProjectName + ".Utilities",
                          dt.ProjectName + ".Managers",
                          dt.ProjectName + ".Models.Repositories",
                          dt.ProjectName + ".Global", "TNT.IoContainer.Wrapper");
            //ResolveMapping.Add("context", EInfo.Data.ContextName);
            ResolveMapping.Add("entity", EInfo.EntityName);
            ResolveMapping.Add("entityPK", EInfo.PKClass);

            //GENERATE
            GenerateNamespace();
            GenerateIEntityService();
            GenerateEntityService();
            GenerateEntityServiceBody();
        }
        public ContextManagerGen(DataInfo dt)
        {
            Data = dt;
            Directive.Add("TNT.IoContainer.Container",
                          Data.ProjectName + ".Global", Data.ProjectName + ".Models");
            ResolveMapping.Add("context", Data.ContextName);

            //GENERATE
            //GENERATE
            GenerateNamespace();
            GenerateContextManager();
            GenerateOpenMethod();
            GenerateOpenMethod(true);
            GenerateOpenGetMethod();
            GenerateOpenGetMethod(true);
            GenerateOpenAsyncMethod();
            GenerateOpenAsyncMethod(true);
            GenerateOpenGetAsyncMethod();
            GenerateOpenGetAsyncMethod(true);
        }
示例#20
0
        public GlobalGen(DataInfo dt)
        {
            Data = dt;
            Directive.Add("TNT.IoContainer.Container", "AutoMapper",
                          "System.Web",
                          Data.ProjectName + ".Models",
                          Data.ProjectName + ".Models.Repositories",
                          Data.ProjectName + ".Models.Services",
                          Data.ProjectName + ".Managers",
                          Data.ProjectName + ".ViewModels");

            //GENERATE
            GenerateNamespace();
            GenerateGlobal();
            GenerateInitMethod();
            //GenerateHttpApp();
            GenerateMapperConfig();
            GenerateInitMapper();
            GenerateInitContainer();
        }
        public ExecutionDocumentWalkerOptions Add(object visitor)
        {
            if (visitor is IVisit <ExecutableDocument> ed)
            {
                ExecutableDocument.Add(ed);
            }

            if (visitor is IVisit <FragmentDefinition> fd)
            {
                FragmentDefinition.Add(fd);
            }

            if (visitor is IVisit <OperationDefinition> od)
            {
                OperationDefinition.Add(od);
            }

            if (visitor is IVisit <SelectionSet> ss)
            {
                SelectionSet.Add(ss);
            }


            if (visitor is IVisit <ISelection> s)
            {
                Selection.Add(s);
            }

            if (visitor is IVisit <FieldSelection> fs)
            {
                FieldSelection.Add(fs);
            }

            if (visitor is IVisit <InlineFragment> ift)
            {
                InlineFragment.Add(ift);
            }

            if (visitor is IVisit <FragmentSpread> fgs)
            {
                FragmentSpread.Add(fgs);
            }

            if (visitor is IVisit <Argument> arg)
            {
                Argument.Add(arg);
            }

            if (visitor is IVisit <NamedType> nt)
            {
                NamedType.Add(nt);
            }

            if (visitor is IVisit <VariableDefinition> vd)
            {
                VariableDefinition.Add(vd);
            }

            if (visitor is IVisit <DefaultValue> dv)
            {
                DefaultValue.Add(dv);
            }

            if (visitor is IVisit <Value> v)
            {
                Value.Add(v);
            }

            if (visitor is IVisit <Directive> d)
            {
                Directive.Add(d);
            }

            if (visitor is IVisit <TypeBase> t)
            {
                Type.Add(t);
            }

            return(this);
        }