public override void Build() { var restBuilder = new RestBuilder(logic); foreach (var item in restBuilder.Resources) { web.AddFile(new ApiControllerFile(web, type, item)); if (Vs.Helper.Solution.UseTypeScript) { var service = WebFrameworkFileFactory.GetTypeScriptFile(web, type, item); web.AddFile(service); } else { var service = WebFrameworkFileFactory.GetJavaScriptFile(web, type, item); web.AddFile(service); } } var modelTypes = new ClientModelFactory(logic).GetTypes(); web.AddFile(new ApiControllerBaseFile(web)); if (Vs.Helper.Solution.UseTypeScript) { var models = WebFrameworkFileFactory.GetTypeScriptModelsFile(web, modelTypes.ToArray()); web.AddFile(models); } web.AddFile(new CustomAuhtorizeAttributeFile(web)); web.AddFile(new IndexHtmlFile(web)); }
public List<Type> GetTypes() { var restBuilder = new RestBuilder(project); var modelTypes = new List<Type>(); foreach (var item in restBuilder.Resources) { foreach (var verb in item.Verbs) { modelTypes.Add(verb.RequestType); modelTypes.Add(verb.ResponseType); } } modelTypes.AddRange(project.ClientTypes); return modelTypes.OrderBy(c=>c.Name).ToList(); }