public ResponseWrapper <EditSchemaModel> EditSchema(int schemaId, EditSchemaInputModel model) { var entity = context .Schemas .Single(x => x.SchemaId == schemaId ); entity.Name = model.Name; entity.ApplicationId = model.ApplicationId; context.SaveChanges(); var response = new EditSchemaModel { Name = entity.Name, SchemaId = entity.SchemaId, ApplicationId = entity.ApplicationId, }; return(new ResponseWrapper <EditSchemaModel>(_validationDictionary, response)); }
public dynamic EditSchema(int schemaId, [FromBody] EditSchemaInputModel model) { var orchestrator = new SchemaOrchestrator(new ModelStateWrapper(this.ModelState)); return(orchestrator.EditSchema(schemaId, model).GetResponse()); }