public ImagesGridSystemLogic(LinkedList <Image> images, ImageShareDbContext cntx1, ApplicationDbContext cntx2, int columns) { ImageShareDatabase = cntx1; UsersDatabase = cntx2; Columns = columns; Images = new LinkedList <Image>(images); }
public ActionResult CreateAlbum(AlbumViewModel model) { if (ModelState.IsValid) { ImageShareDbContext ImagesContext = HttpContext.GetOwinContext().Get <ImageShareDbContext>(); Album album = new Album(); album.Name = model.Name; album.ApplicationUserID = HttpContext.User.Identity.GetUserId(); album.Type = AlbumType.Album; ImagesContext.Albums.Add(album); ImagesContext.SaveChanges(); return(RedirectToAction("AddImages", "Images")); } return(View(model)); }