public string GetEntitySchemaModels(string entitySchema) { if (UserConnection.DBSecurityEngine.GetCanExecuteOperation("CanManageSolution")) { var generator = new EntitySchemaModelClassGenerator(UserConnection.EntitySchemaManager); var models = generator.Generate(entitySchema); return(JsonConvert.SerializeObject(models, Formatting.Indented)); } else { throw new Exception("You don`n have permission for operation CanManageSolution"); } }
public string GetEntitySchemaModels(string entitySchema, string fields) { if (UserConnection.DBSecurityEngine.GetCanExecuteOperation("CanManageSolution")) { var generator = new EntitySchemaModelClassGenerator(UserConnection.EntitySchemaManager); var columns = new List <string>(); if (!String.IsNullOrEmpty(fields)) { columns = new List <string>(fields.Split(',')); } var models = generator.Generate(entitySchema, columns); return(JsonConvert.SerializeObject(models, Formatting.Indented)); } else { throw new Exception("You don't have permission for operation CanManageSolution"); } }