public ServiceFile(ProjectFacade project, TypeFacade type, Resource resource) : base(project, type, resource) { Template = new ServiceTemplate { File = this }; Name = resource.Name; Name = $"{Name}Service"; }
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 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 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 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 RestBuilder(ProjectFacade logic) { Resources = new List<Resource>(); var assembly = logic.Assembly; Type[] types = assembly.GetTypesSafetly(); var interestingTypes = types.Where(c => c.GetCustomAttributes(typeof (RestAttribute), false).Any()).ToArray(); var resources = interestingTypes.ToLookup( c => c.GetCustomAttributes(typeof (RestAttribute), false).First().To<RestAttribute>().Resource, c => buildVerb(c.GetCustomAttributes(typeof (RestAttribute), false).First(), c)); foreach (var key in resources.Select(c => c.Key).ToArray()) { var name = key; var resource = new Resource { Name = name, ClassName = $"{name}Controller" }; resource.Verbs.AddRange(resources[key]); Resources.Add(resource); } }
public TsServiceFile(ProjectFacade project, TypeFacade type, Resource resource) : base(project, type, resource) { Template = new TsServiceTemplate { File = this }; }