예제 #1
0
        public async Task <ActionResult> GetCabin(int id)
        {
            var cabinInDb = await _cabinRepository.GetCabinAsync(id);

            if (cabinInDb == null)
            {
                return(NotFound());
            }

            return(Ok(CabinResource.FromData(cabinInDb)));
        }
예제 #2
0
 public async Task UpdateDataAsync(Kid data, ICabinRepository cabinRepository)
 {
     data.Name = Name;
     if (data.CabinId != CabinId)
     {
         data.CabinId = CabinId;
         data.Cabin   = await cabinRepository.GetCabinAsync(CabinId);
     }
 }