Example #1
0
        public void Edit(System.Guid emailSubscriptionId, [FromBody] Frapid.WebsiteBuilder.Entities.EmailSubscription emailSubscription)
        {
            if (emailSubscription == null)
            {
                throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.MethodNotAllowed));
            }

            try
            {
                this.EmailSubscriptionRepository.Update(emailSubscription, emailSubscriptionId);
            }
            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.EmailSubscription emailSubscription = Fixture().GetLast();
     Assert.NotNull(emailSubscription);
 }
Example #3
0
 public void Next()
 {
     Frapid.WebsiteBuilder.Entities.EmailSubscription emailSubscription = Fixture().GetNext(new System.Guid());
     Assert.NotNull(emailSubscription);
 }