/// <summary> /// Updates the asynchronous. /// </summary> /// <param name="hotel">The stylemodel.</param> /// <returns> /// UpdateAsync /// </returns> /// <exception cref="ArgumentNullException">category</exception> public async Task <int> UpdateAsync(PackageHotelModel hotel) { if (hotel == null) { throw new ArgumentNullException("city"); } this.hotel.UpdateCompleteGraph(hotel, hotel.Id); return(await this.hotel.SaveChangesAsync()); }
/// <summary> /// Inserts the asynchronous. /// </summary> /// <param name="hotel">The hotel.</param> /// <returns> /// InsertAsync /// </returns> /// <exception cref="ArgumentNullException">category</exception> public async Task <int> InsertAsync(PackageHotelModel hotel) { try { if (hotel == null) { throw new ArgumentNullException("hotel"); } return(await this.hotel.InsertAsync(hotel)); } catch (Exception ex) { throw ex; } }