Exemplo n.º 1
0
        public Task <Guid> AddWineAsync(Wine wine)
        {
            wine.Id = Guid.NewGuid();
            WineContext.Wines.Add(wine);
            var result = WineContext.SaveChanges() > 0 ? wine.Id : Guid.Empty;

            return(Task.FromResult(result));
        }
Exemplo n.º 2
0
        public Task <Guid> AddWineryAsync(Winery winery)
        {
            winery.Id = Guid.NewGuid();
            wineryContext.Wineries.Add(winery);
            var result = wineryContext.SaveChanges() > 0 ? winery.Id : Guid.Empty;

            return(Task.FromResult(result));
        }