Example #1
0
        public void Edit(int menuItemId, [FromBody] Frapid.WebsiteBuilder.Entities.MenuItem menuItem)
        {
            if (menuItem == null)
            {
                throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.MethodNotAllowed));
            }

            try
            {
                this.MenuItemRepository.Update(menuItem, menuItemId);
            }
            catch (UnauthorizedException)
            {
                throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.Forbidden));
            }
            catch (DataAccessException ex)
            {
                throw new HttpResponseException(new HttpResponseMessage
                {
                    Content    = new StringContent(ex.Message),
                    StatusCode = HttpStatusCode.InternalServerError
                });
            }
#if !DEBUG
            catch
            {
                throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.InternalServerError));
            }
#endif
        }
Example #2
0
 public void Last()
 {
     Frapid.WebsiteBuilder.Entities.MenuItem menuItem = Fixture().GetLast();
     Assert.NotNull(menuItem);
 }
Example #3
0
 public void Previous()
 {
     Frapid.WebsiteBuilder.Entities.MenuItem menuItem = Fixture().GetPrevious(0);
     Assert.NotNull(menuItem);
 }