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));
        }
示例#2
0
 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;
     }));
 }
示例#3
0
 public Task <int> AddDocumentTemplate(EditDocumentTemplateModel model)
 {
     return(Add <DocumentTemplate, IDocumentTemplateRepository>(template => template.Id, model.GetEntity));
 }