public ResponseWrapper<TestEditEntityModel> EditEntity(int entityId, TestEditEntityInputModel model) { var entity = context .Entities .Single(x => x.EntityId == entityId ); entity.Name = model.Name; entity.Properties = model.Properties .Select(x => new Property { Name = x.Name, } ) .ToList(); context.SaveChanges(); var response = new TestEditEntityModel { Name = entity.Name, EntityId = entity.EntityId, }; return new ResponseWrapper<TestEditEntityModel>(_validationDictionary, response); }
public dynamic EditEntity(int entityId, [FromBody] TestEditEntityInputModel model) { var orchestrator = new EntityTestOrchestrator(new ModelStateWrapper(this.ModelState)); return(orchestrator.EditEntity(entityId, model).GetResponse()); }