public async Task <BlogSub> AddBlogSubAsync(BlogSub blogSub) { await _dataContext.BlogSubs.AddAsync(blogSub); await _dataContext.SaveChangesAsync(); return(blogSub); }
public async Task <IActionResult> OnPost() { BlogSub blogSub = new BlogSub() { Subtitle = ViewModel.SubTitle, Details = ViewModel.SubDetails, BlogId = Id }; _ = await _blogService.AddBlogSubAsync(blogSub); return(RedirectToPage()); }