Ejemplo n.º 1
0
        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"));
        }
Ejemplo n.º 2
0
        public IActionResult Create()
        {
            var model = new VicNaDenqViewModel();

            return(this.View(model));
        }