public ServiceFile(ProjectFacade project, TypeFacade type, Resource resource) : base(project, type, resource) { Template = new ServiceTemplate { File = this }; Name = resource.Name; Name = $"{Name}Service"; }
public RestResourcesFile(ProjectFacade project) : base(project) { Template = new RestResourcesTemplate {File = this}; Name = "RestResources"; OverwriteExistingFile = true; }
public MessageFile(ProjectFacade project, TypeFacade type) : base(project, type) { Template = new MessageTemplate {File = this}; Name = string.Format("{0}Message", Name); HasDetail = type.HasDetailFlag; }
public ListsRequestFile(ProjectFacade project) : base(project, null) { Template = new ListsRequestTemplate {File = this}; Name = "ListsRequest"; PageSpecificUsingStatements.Add("System.Collections.Generic"); }
public ConstantsFile(ProjectFacade project) : base(project) { Template = new ConstantsTemplate {File = this}; Name = "Constants"; OverwriteExistingFile = true; }
public CustomAuhtorizeAttributeFile(ProjectFacade project) : base(project) { Template = new CustomAuhtorizeAttributeTemplate { File = this }; Name = "CustomAuhtorizeAttribute"; OverwriteExistingFile = false; }
public IocFile(ProjectFacade project) : base(project) { Template = new IocTemplate {File = this}; Name = "Ioc"; PageSpecificUsingStatements.Add(ContextNamespace); }
public ApiControllerBaseFile(ProjectFacade project) : base(project) { Template = new ApiControllerBaseTemplate {File = this}; Name = "ApiControllerBase"; OverwriteExistingFile = false; }
public MappingTestsFile(ProjectFacade project, TypeFacade type, ProjectFacade logic) : base(project, type) { Template = new MappingTestsTemplate {File = this}; Name = string.Format("{0}MappingTests", Name); PageSpecificUsingStatements.Add(logic.RootNamespace + ".Operations." + PluralName); PageSpecificUsingStatements.Add(Type.Namespace); }
public DetailQueryFile(ProjectFacade project, TypeFacade type) : base(project, type) { Template = new DetailQueryTemplate {File = this}; Name = string.Format("{0}DetailQuery", Name); if (HasContext) PageSpecificUsingStatements.Add(ContextNamespace); }
protected TypedTestFile(ProjectFacade project, TypeFacade type) : base(project, type) { Tests = Vs.Helper.TestingFramework; Tests.RequiredNamespaces.AsEnumerable() .ForEach(c => PageSpecificUsingStatements.Add(c)); PageSpecificUsingStatements.Add("FluentAssertions"); }
public ListsEnumFile(ProjectFacade project, TypeInformation[] types) : base(project, null) { Template = new ListsEnumTemplate {File = this}; Names = types.Select(c => c.Name).ToArray(); Name = "Lists"; OverwriteExistingFile = true; }
public AddCommandTestsFile(ProjectFacade project, TypeFacade type, ProjectFacade logic) : base(project, type) { Template = new AddCommandTestsTemplate {File = this}; Name = string.Format("{0}AddCommandTests", Name); PageSpecificUsingStatements.Add(logic.RootNamespace + ".Operations." + PluralName); PageSpecificUsingStatements.Add("Voodoo.TestData"); }
public SampleFile(ProjectFacade project, TypeFacade type) : base(project, type) { Template = new SampleTemplate {File = this}; Name = string.Format("{0}Sample", Name); PageSpecificUsingStatements.Add(ContextNamespace); PageSpecificUsingStatements.Add(type.Namespace); PageSpecificUsingStatements.Add("Voodoo.Infrastructure"); }
public HelperFile(ProjectFacade project, TypeFacade type) : base(project, type) { FriendlyName = Name.ToFriendlyString(); Template = new HelperTemplate {File = this}; Name = string.Format("{0}Helper", Name); PageSpecificUsingStatements.Add(Type.Namespace); Errors = type.Properties.SelectMany(c => c.ErrorMessages).Select(c => c.Text).ToArray(); }
public ListsResponseFile(ProjectFacade project, TypeInformation[] types) : base(project, null) { Template = new ListsResponseTemplate {File = this}; Name = "ListsResponse"; OverwriteExistingFile = true; TypeNames = types.Select(c => c.PluralName).ToArray(); PageSpecificUsingStatements.Add("Voodoo.Messages"); PageSpecificUsingStatements.Add("System.Collections.Generic"); }
public MappingTestHelperFile(ProjectFacade project) : base(project) { Tests = Vs.Helper.TestingFramework; Tests.RequiredNamespaces.AsEnumerable() .ForEach(c => PageSpecificUsingStatements.Add(c)); PageSpecificUsingStatements.Add("FluentAssertions"); Template = new MappingTestHelperTemplate {File = this}; Name = "MappingTestHelper"; }
public EditCommandFile(ProjectFacade project, TypeFacade type) : base(project, type) { Template = new EditCommandTemplate {File = this}; Name = string.Format("{0}EditCommand", Name); PageSpecificUsingStatements.Add(ContextNamespace); PageSpecificUsingStatements.Add(type.Namespace); PageSpecificUsingStatements.Add("Voodoo.Infrastructure"); UseSoftEdit = type.HasActiveFlag; }
public TestHelperFile(ProjectFacade project, TypeFacade type, ProjectFacade logic) : base(project, type) { Template = new TestHelperTemplate {File = this}; Name = string.Format("{0}TestHelper", Name); PageSpecificUsingStatements.Add(logic.RootNamespace + ".Operations." + PluralName); PageSpecificUsingStatements.Add("Voodoo.TestData"); PageSpecificUsingStatements.Add(ContextNamespace); PageSpecificUsingStatements.Add(logic.RootNamespace); }
public ListQueryFile(ProjectFacade project, TypeFacade type) : base(project, type) { Template = new ListQueryTemplate {File = this}; Name = string.Format("{0}ListQuery", Name); if (HasContext) { PageSpecificUsingStatements.Add(ContextNamespace); PageSpecificUsingStatements.Add("Voodoo"); } }
protected TsServiceFileBase(ProjectFacade project, TypeFacade type, Resource resource) : base(project, type) { Name = resource.Name; TsName = firstLetterLower(Name); Name = $"{Name}Factory"; Resource = resource; OverwriteExistingFile = true; Builder = new TypeScriptGraphBuilder(); }
public JsServiceFile(ProjectFacade project, TypeFacade type, Resource resource) : base(project, type) { Name = resource.Name; Template = new JsServiceTemplate {File = this}; JsName = firstLetterLower(Name); Name = string.Format("{0}Factory", Name); Resource = resource; OverwriteExistingFile = true; Template = new JsServiceTemplate {File = this}; }
public ListsHelperFile(ProjectFacade project, TypeInformation[] types) : base(project, null) { Template = new ListsHelperTemplate {File = this}; Name = "ListsHelper"; Types = types; OverwriteExistingFile = true; PageSpecificUsingStatements.Add("Voodoo.Messages"); PageSpecificUsingStatements.Add("System.Collections.Generic"); PageSpecificUsingStatements.Add("System.Linq"); PageSpecificUsingStatements.Add(ContextNamespace); }
public static CodeFile GetJavaScriptFile(ProjectFacade web, TypeFacade type, Resource item) { if (Vs.Helper.Solution.WebFramework == WebFramework.Angular1) { var service = new Angular.JsServiceFile(web, type, item); return service; } else if (Vs.Helper.Solution.WebFramework == WebFramework.Aurelia) { var service = new Aurelia.JsServiceFile(web, type, item); return service; } throw new NotImplementedException(); }
public static CodeFile GetTypeScriptModelsFile(ProjectFacade web, Type[] types) { if (Vs.Helper.Solution.WebFramework == WebFramework.Angular1) { var service = new Angular.TypeScriptModelsFile(web, types); return service; } else if (Vs.Helper.Solution.WebFramework == WebFramework.Aurelia) { var service = new Aurelia.TypeScriptModelsFile(web, types); return service; } throw new NotImplementedException(); }
public ApiControllerFile(ProjectFacade project, TypeFacade type, Resource resource) : base(project, type) { Resource = resource; OverwriteExistingFile = true; Template = new ApiControllerTemplate {File = this}; Name = resource.Name; PageSpecificUsingStatements.Add("Voodoo.Messages"); foreach (var verb in resource.Verbs) { addNamespaces(verb.OperationType); addNamespaces(verb.RequestType); addNamespaces(verb.ResponseType); } }
public TestFile(ProjectFacade project, TypeFacade type, ProjectFacade logic) : base(project, type) { this.Operation = Operation.DiscoverTypes(type.SystemType, new Operation()); if (Operation != null) { this.PageSpecificUsingStatements.Add(Operation.RequestType.Namespace); } LogicProject = logic; Template = new TestTemplate { File = this }; Name = string.Format("{0}Tests", Name); PageSpecificUsingStatements.Add(ContextNamespace); PageSpecificUsingStatements.Add(logic.RootNamespace); PageSpecificUsingStatements.Add(Type.Namespace); }
protected CodeFile(ProjectFacade project) { if (project != null) { Project = project; PageSpecificUsingStatements = new List<string>(); if (Vs.Helper.Solution.ContextType != null) { HasContext = true; ContextName = Vs.Helper.Solution.ContextType.Name; ContextNamespace = Vs.Helper.Solution.ContextType.Namespace; } } }
public static TsServiceFileBase GetTypeScriptFile(ProjectFacade web, TypeFacade type, Resource item) { //TODO:refactor if (Vs.Helper.Solution.WebFramework == WebFramework.Angular1) { var service = new Angular.TsServiceFile(web, type, item); service.Template = new Angular.TsServiceTemplate { File = service }; return service; } else if (Vs.Helper.Solution.WebFramework == WebFramework.Aurelia) { var service = new Aurelia.TsServiceFile(web, type, item); service.Template = new Aurelia.TsServiceTemplate { File = service }; return service; } throw new NotImplementedException(); }
public MapperFile(ProjectFacade project, TypeFacade type) : base(project, type) { HasDetail = type.HasDetailFlag; Template = new MapperTemplate { File = this }; Name = string.Format("{0}Mapper", Name); ModelName = string.Format("{0}", type.Name); PageSpecificUsingStatements.Add(Type.Namespace); OverwriteExistingFile = true; var modelType = type; var messageType = Vs.Helper.FindType(Type.MessageName); addMapping(messageType, Type.MessageProperties, $"Message"); if (HasDetail) { messageType = Vs.Helper.FindType(Type.DetailName); addMapping(messageType, Type.DetailMessageProperties, $"Detail"); } var mappings = project.MappingTypes.ToArray(); foreach (var map in mappings) { var attribute = map.GetCustomAttribute<MapsToAttribute>(); if (attribute.Type.FullName == type.SystemType.FullName) { var facade = new TypeFacade(map); Mappings.Add(new Mapping(Type, facade)); PageSpecificUsingStatements.Add(facade.SystemType.Namespace); } } }