public async Task <HttpResponseMessage> Update([FromUri] int id, [FromBody] EditDocumentTemplateModel model) { Log.Out.BeginInfo(model.ToJson(), "UpdateDocumentTemplate Id: {0}", id); await Service.Get <ITemplateService>().UpdateDocumentTemplate(id, model); Log.Out.EndInfo("UpdateDocumentTemplate Id: {0}", id); return(Request.CreateResponse(HttpStatusCode.OK)); }
public Task UpdateDocumentTemplate(int id, EditDocumentTemplateModel model) { return(Update <DocumentTemplate, IDocumentTemplateRepository>(id, template => { var entity = model.GetEntity(); template.Name = entity.Name; template.Reference = entity.Reference; template.Purpose = entity.Purpose; template.ComponentId = entity.ComponentId; })); }
public Task <int> AddDocumentTemplate(EditDocumentTemplateModel model) { return(Add <DocumentTemplate, IDocumentTemplateRepository>(template => template.Id, model.GetEntity)); }