public async Task <string> CreateDescriptivePaper(DescriptivePaperDTO DesPaper) { string code = CodeGenerator.GetSharableCode(EPaperType.Descriptive); DesPaper.PaperCode = code; string linkwith = await Fire.Upload(DesPaper.paper.OpenReadStream(), null, code); DesPaper.PaperPdfUrl = linkwith.Replace("&", Fire.Ampersand); DescriptivePaper paper = Mapper.Map <DescriptivePaperDTO, DescriptivePaper>(DesPaper); DescriptivePaperRepo.Create(paper); EmailService.SendMailForPaper(code, linkwith, paper.PaperTitle, paper.CreatedDate.ToString(), paper.DeadLine.ToString(), paper.TeacherEmailId); //sends mail regarding paper update return(code); }
public DescriptivePaper Create(DescriptivePaper paper) { AppDbContext.DescriptivePapers.Add(paper); AppDbContext.SaveChanges(); return(paper); }