public static String Get(JsonSchema4 schema, String ns) { String Model, model; NameGenerator.CreatePascalAndCamel(schema.Title, out Model, out model); String Models, models; NameGenerator.CreatePascalAndCamel(schema.GetPluralName(), out Models, out models); var authAttribute = ""; String authName = schema.GetAuthorizationRoleString(); if (authName != null) { authAttribute = $@"[Authorize(Roles = {authName})] "; } return(Create(ns, NameGenerator.CreatePascal(schema.GetUiControllerName()), Model, model, Models, models, authAttribute)); }
public static String Get(JsonSchema4 schema, String ns) { String Model, model; NameGenerator.CreatePascalAndCamel(schema.Title, out Model, out model); String Models, models; NameGenerator.CreatePascalAndCamel(schema.GetPluralName(), out Models, out models); String ModelId, modelId; NameGenerator.CreatePascalAndCamel(schema.GetKeyName(), out ModelId, out modelId); var additionalAuthorize = ""; String authName = schema.GetAuthorizationRoleString(); if (authName != null) { additionalAuthorize = $", Roles = {authName}"; } return(Create(ns, Model, model, Models, models, additionalAuthorize, schema.GetKeyType().Name, ModelId, modelId, schema.GetExtraNamespaces(StrConstants.FileNewline))); }