public async Task <IActionResult> Create([Bind("ConvBlogItemID,ConvName,ConvCreatorName")] ConvBlogItem convBlogItem) { using (ApplicationDbContextcs db = new ApplicationDbContextcs()) { if (ModelState.IsValid) { db.Add(convBlogItem); await db.SaveChangesAsync(); return(RedirectToAction("Blog", "App")); } return(View(convBlogItem)); } }
public async Task <IActionResult> Create([Bind("UId,FirstName,LastName,Email,UserName,Password,ConfirmPassword,UPriv")] UserAcccount userAcccount) { using (ApplicationDbContextcs db = new ApplicationDbContextcs()) { if (ModelState.IsValid) { db.Add(userAcccount); await db.SaveChangesAsync(); string url = @"../../App/Settings"; return(Redirect(url)); } return(View(userAcccount)); } }
public async Task <IActionResult> Create([Bind("BlogItemID,ConvID,UID,Subject,Message,RelatedID")] BlogItem blogItem) { using (ApplicationDbContextcs db = new ApplicationDbContextcs()) { if (ModelState.IsValid) { blogItem.Date = DateTime.Now; db.Add(blogItem); await db.SaveChangesAsync(); string url = @"../../ConvBlogItems/Conversation/" + blogItem.ConvID; return(Redirect(url)); } return(View(blogItem)); } }