public async Task <HttpResponseMessage> Update([FromUri] int id, [FromBody] EditBusinessProcessAttributeModel model) { Log.Out.BeginInfo(model.ToJson(), "UpdateBusinessProcessAttribute Id: {0}", id); await Service.Get <IBusinessProcessService>().UpdateBusinessProcessAttribute(id, model); Log.Out.EndInfo("UpdateBusinessProcessAttribute Id: {0}", id); return(Request.CreateResponse(HttpStatusCode.OK)); }
public async Task <HttpResponseMessage> Add([FromBody] EditBusinessProcessAttributeModel model) { Log.Out.BeginInfo(model.ToJson(), "AddBusinessProcessAttribute"); var id = await Service.Get <IBusinessProcessService>().AddBusinessProcessAttribute(model); Log.Out.EndInfo("AddBusinessProcessAttribute Id: {0}", id); return(Request.CreateResponse(HttpStatusCode.OK, new { Id = id })); }
public Task UpdateBusinessProcessAttribute(int id, EditBusinessProcessAttributeModel model) { return(Update <BusinessProcessAttribute, IBusinessProcessAttributeRepository>(id, entity => { var newEntity = model.GetEntity(); entity.Name = newEntity.Name; entity.Description = newEntity.Description; entity.AttributeTypeId = newEntity.AttributeTypeId; })); }
public Task <int> AddBusinessProcessAttribute(EditBusinessProcessAttributeModel model) { return(Add <BusinessProcessAttribute, IBusinessProcessAttributeRepository>(entity => entity.Id, model.GetEntity)); }