public async Task AddNewGallery() { var identity = await UserManager.FindByNameAsync(User.Identity.Name); Gallery gallery = new Gallery(); gallery.Name = "Galery for " + identity.UserName; gallery.OwnerId = identity.Id; try { gallery = AppUnityOfWork.GalleriesRepository.Add(gallery); UserService.AddGallery(gallery, identity.Id); } catch (Exception e) { throw; } }