public async Task <IActionResult> CreateAsync(VicNaDenqViewModel daily) { if (!this.ModelState.IsValid) { return(this.View(daily)); } var vic = new VicNaDenq() { Content = daily.Content, Day = DateTime.Today, VicType = daily.VicType, }; await this.dailyRepo.AddAsync(vic); await this.dailyRepo.SaveChangesAsync(); return(this.RedirectToPage("/Home/Index")); }
public IActionResult Create() { var model = new VicNaDenqViewModel(); return(this.View(model)); }