public int AddTemplate(TemplateMasterModel model) { try { Mapper.CreateMap<TemplateMasterModel, MainTemplatesHtml>(); var template = Mapper.Map<TemplateMasterModel, MainTemplatesHtml>(model); int i = dbContext.SaveChanges(); return i; } catch (Exception ex) { logger.Error("Method: AddTemplate()", ex); return 0; } }
public int EditTemplate(TemplateMasterModel model) { try { Mapper.CreateMap<TemplateMasterModel, MainTemplatesHtml>(); var template = Mapper.Map<TemplateMasterModel, MainTemplatesHtml>(model); dbContext.Entry(template).State = EntityState.Modified; int i = dbContext.SaveChanges(); return i; } catch(Exception ex) { logger.Error("Method: EditTemplate()", ex); return 0; } }
public string EditTemplate(TemplateMasterModel Template) { int i =tservice.EditTemplate(Template); return Newtonsoft.Json.JsonConvert.SerializeObject(i); }