public GuestCategoryDto Create(GuestCategoryDto guestCategoryDto) { var guestCategory = guestCategoryDto.CreateModel(); this._context.GuestCategories.Add(guestCategory); this._context.SaveChanges(); return(new GuestCategoryDto(guestCategory)); }
public GuestCategoryDto Update(GuestCategoryDto guestCategoryDto) { var guestCategory = this._context.GuestCategories.Find(guestCategoryDto.Id); if (guestCategory == null) { throw new HttpResponseException(HttpStatusCode.NotFound); } guestCategoryDto.Update(guestCategory); this._context.SaveChanges(); return(new GuestCategoryDto(guestCategory)); }