public async Task <TemplateModel> PutTemplateData(string data) { var templateModelDb = new TemplateModelDb() { Content = data }; DbContext.TemplateModels.Add(templateModelDb); await DbContext.SaveChangesAsync(); return(TypeMappingService.Map <TemplateModelDb, TemplateModel>(templateModelDb)); }
public async Task <List <TemplateModel> > GetAllTemplateData() { var templateModel = await DbContext.TemplateModels.ToListAsync(); return(TypeMappingService.Map <List <TemplateModelDb>, List <TemplateModel> >(templateModel)); }