Beispiel #1
0
 public UnitOfWork(BookServiceContext context)
 {
     _context           = context;
     Books              = new BookRepository(_context);
     Users              = new UserRepository(_context);
     UserBooks          = new UserBookRepository(_context);
     RegisteredApiUsers = new RegisteredApiUserRepository(_context);
 }
        public override void OnAuthorization(System.Web.Http.Controllers.HttpActionContext actionContext)
        {
            var environmentId = actionContext.Request.GetUserAccessToken();

            using (var db = new BookServiceContext())
            {
                var environment = db.Environments.Find(environmentId);
                if (environment == null)
                {
                    //throw new HttpResponseException(HttpStatusCode.Forbidden);
                    var host = actionContext.Request.RequestUri.DnsSafeHost;
                    actionContext.Response = actionContext.Request.CreateResponse(HttpStatusCode.NotFound);
                    actionContext.Response.Headers.Add("NoStore", string.Format("No store \"{0}\"", environmentId));
                }
            }

            base.OnAuthorization(actionContext);
        }
Beispiel #3
0
 public AuthorsController(BookServiceContext context)
 {
     _context = context;
 }
Beispiel #4
0
 public PublisherRepository(BookServiceContext context, IMapper mapper) : base(context, mapper)
 {
 }
 /// <summary>
 /// This will create the books controller version 2
 /// </summary>
 /// <param name="context">The book service context, this will be injected</param>
 public BooksV2Controller(BookServiceContext context)
 {
     db = context;
 }
 public Repository(BookServiceContext context)
 {
     db = context;
 }
 public RegisteredApiUserRepository(BookServiceContext context) : base(context)
 {
 }
Beispiel #8
0
 public BookRepository(BookServiceContext context) : base(context)
 {
 }
 public PublisherRepository(BookServiceContext context) : base(context)
 {
 }
 public MappingRepository(BookServiceContext bookserviceContext, IMapper mapper)
     : base(bookserviceContext)
 {
     this.mapper = mapper;
 }
 public BooksController(BookServiceContext db)
 {
     _db = db;
 }
Beispiel #12
0
 public RatingRepository(BookServiceContext context) : base(context)
 {
 }
 //nodig voor de injectie
 public PublisherRepository(BookServiceContext context)
 {
     bookServiceContext = context;
 }
 public ReaderRepository(BookServiceContext context) : base(context)
 {
 }
Beispiel #15
0
 public UnitOfWork(BookServiceContext context)
 {
     this.context      = context;
     BooksRepository   = new BookRepository(context);
     AuthorsRepository = new AuthorRepository(context);
 }
        //private BookServiceContext bookServiceContext;

        public AuthorRepository(BookServiceContext context) : base (context)
        {
            //bookServiceContext = context;
        }
 public CompletedOrdersController(BookServiceContext context)
 {
     _context = context;
 }
 public PhysicalBooksController(BookServiceContext context)
 {
     _context = context;
 }
Beispiel #19
0
 public BookRepository(BookServiceContext context)
 {
     bookServiceContext = context;
 }
 public BooksController(BookServiceContext context)
 {
     _context = context;
 }
Beispiel #21
0
 public AuthorRepository(BookServiceContext context)
 {
     bookServiceContext = context;
 }
Beispiel #22
0
 public AuthorsController(BookServiceContext db)
 {
     _db = db;
 }