Example #1
0
 public static BeerTap ToBeerTapResource(this BeerTapDto dto)
 {
     return(new BeerTap
     {
         Id = dto.Id,
         BeerName = dto.BeerName,
         OfficeId = dto.OfficeId,
         Status = (BeerTapStatus)dto.Status,
         Volume = dto.Volume
     });
 }
Example #2
0
        private BeerTapStatus GetNewStatus(BeerTapDto beerTap)
        {
            if (beerTap.Volume > _almostEmptyThreshold)
            {
                return(BeerTapStatus.GoinDown);
            }

            if ((beerTap.Volume < _almostEmptyThreshold) && (beerTap.Volume > 0))
            {
                return(BeerTapStatus.AlmostEmpty);
            }

            return(BeerTapStatus.SheIsDryMate);
        }
Example #3
0
 public BeerTapDto Save(BeerTapDto entity)
 {
     _context.BeerTaps.AddOrUpdate(entity);
     _context.SaveDbChanges();
     return(entity);
 }