예제 #1
0
 protected override void Initialize(HttpControllerContext controllerContext)
 {
     base.Initialize(controllerContext);
     context       = new MobileServiceContext();
     DomainManager = new SimpleMappedEntityDomainManager <RestaurantDTO, Restaurant>
                         (context, Request, Services, restaurant => restaurant.Id);
 }
예제 #2
0
 protected override void Initialize(HttpControllerContext controllerContext)
 {
     base.Initialize(controllerContext);
     this.context  = new ServiceDBContext();
     DomainManager = new SimpleMappedEntityDomainManager <TodoItemDTO, TodoItem>
                         (context, Request, Services, todoItem => todoItem.Id);
 }
예제 #3
0
 protected override void Initialize(HttpControllerContext controllerContext)
 {
     base.Initialize(controllerContext);
     context       = new MobileServiceContext();
     DomainManager = new SimpleMappedEntityDomainManager <AdminDTO, Admin>
                         (context, Request, Services, admin => admin.Id);
 }
        protected override void Initialize(HttpControllerContext controllerContext)
        {
            base.Initialize(controllerContext);
            context = new MobileServiceContext();

            context.Database.Log = s =>
            {
                Debug.WriteLine(s.ToString());
            };

            DomainManager = new SimpleMappedEntityDomainManager <UserProfileDTO, UserProfile>(context, Request, Services,
                                                                                              userProfile => userProfile.Id);
        }
예제 #5
0
        // Initialize the table controller to accept HTTP requests
        protected override void Initialize(HttpControllerContext controllerContext)
        {
            base.Initialize(controllerContext);
            // Setup the connection to the database
            alltheairgeadContext context = new alltheairgeadContext(Services.Settings["ExistingDbConnectionString"]);

            // set DomainManger to the new one that we created
            DomainManager = new SimpleMappedEntityDomainManager <CategoryDto, Catagory>(
                context,
                Request,
                Services,
                Category => Category.CategoryName);
        }
예제 #6
0
        /// <summary>
        /// Initialize the table controller
        /// </summary>
        protected override void Initialize(HttpControllerContext controllerContext)
        {
            base.Initialize(controllerContext);
            //modify the context to use the constructor that will take a connection string - stored in web.config
            alltheairgeadContext context = new alltheairgeadContext(Services.Settings["ExistingDbConnectionString"]);

            // set DomainManger to a new one that we created
            DomainManager = new SimpleMappedEntityDomainManager <ExpenseDto, Expense>(
                context,
                Request,
                Services,
                Expense => Expense.ExpenseId);
        }