Ejemplo n.º 1
0
        public async Task <BatchDetailsDto> GetBatchDetails(int id)
        {
            Batch batch = await BatchDataProvider.GetBatch(id);

            Beer beer = await BeerDataProvider.GetBeer(batch.Beer);

            BatchDetailsDto batchDetailsDto = new BatchDetailsDto()
            {
                Id              = batch.Id,
                Beer            = beer.Name,
                Style           = beer.Style,
                BatchName       = batch.BatchName,
                BatchNumber     = batch.BatchNumber,
                Status          = batch.Status,
                SubStatus       = batch.SubStatus,
                Brewers         = batch.Brewers,
                Recipe          = batch.Recipe,
                Yeast           = batch.Yeast,
                PreBoilGravity  = batch.PreBoilGravity,
                OriginalGravity = batch.OriginalGravity,
                FinalGravity    = batch.FinalGravity,
                ABV             = batch.ABV,
                DateBrewed      = batch.DateBrewed,
                DatePackaged    = batch.DatePackaged,
                DateTapped      = batch.DateTapped,
                BrewingNotes    = batch.BrewingNotes,
                TastingNotes    = batch.TastingNotes,
                Created         = batch.Created,
                CreatedBy       = batch.CreatedBy
            };

            return(batchDetailsDto);
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> GetBatchDetails(int id)
        {
            Log.Information($"Geting Batch Details for ID {id}");
            try
            {
                BatchDetailsDto batch = await BatchService.GetBatchDetails(id);

                return(Ok(batch));
            }
            catch (Exception ex)
            {
                Log.Error($"Error getting batch details for batch with ID \"{id}\".");
                throw;
            }
        }