public async Task <ActionResult> GetCabin(int id) { var cabinInDb = await _cabinRepository.GetCabinAsync(id); if (cabinInDb == null) { return(NotFound()); } return(Ok(CabinResource.FromData(cabinInDb))); }
public async Task UpdateDataAsync(Kid data, ICabinRepository cabinRepository) { data.Name = Name; if (data.CabinId != CabinId) { data.CabinId = CabinId; data.Cabin = await cabinRepository.GetCabinAsync(CabinId); } }