Exemplo n.º 1
0
        public async Task AddWineInLists(int listaId, string url, int idWine)
        {
            Wine wine = await _winesServices.GetWineByIdAsync(idWine);

            AppUser user = await _userManager.FindByEmailAsync(User.Identity.Name);

            await _tastesServices.InsertClickValues(wine.ColourId, wine.SourceId, wine.SweetnesId, 4, user.Id);

            WineListWine wineListWine = new WineListWine
            {
                WineId     = idWine,
                WineListId = listaId
            };
            await _wineListsServices.AddWineInWineListAsync(wineListWine);

            Response.Redirect(url);
        }
Exemplo n.º 2
0
        public async Task AddWineInWineListAsync(WineListWine wineListWine)
        {
            await _context.AddAsync(wineListWine);

            await _context.SaveChangesAsync();
        }
Exemplo n.º 3
0
 public async Task DeleteWineListWineAsync(WineListWine wineListWine)
 {
     _context.WineListWines.Remove(wineListWine);
     await _context.SaveChangesAsync();
 }