Ejemplo n.º 1
0
        public PersistenceStore(string connectionString)
        {
            var connection = new SqlConnection(connectionString);

            _dbUtility = new DatabaseUtility(connection);

            Customers = new CustomerStore(_dbUtility);
            CustomerAuthentications = new CustomerAuthenticationStore(_dbUtility);
            EventEntries            = new EventEntriesStore(_dbUtility);
            Server = new ServerStore(_dbUtility);
            Users  = new UserStore(_dbUtility);
            UserAuthentications = new UserAuthenticationStore(_dbUtility);
            UserSessions        = new UserSessionStore(_dbUtility);
            Views = new ViewStore(_dbUtility);
        }
Ejemplo n.º 2
0
        public ActionResult Index()
        {
            //List<Product> products = _context.Products.Include("Category").ToList();
            //List<Category> categories = _context.Categories.ToList();

            ViewStore model = new ViewStore
            {
                Products             = _context.Products.Include("Category").ToList(),
                Categories           = _context.Categories.ToList(),
                ProductSectionTitle  = "Products",
                CategorySectionTitle = "Categories"
            };



            return(View(model));
        }
Ejemplo n.º 3
0
        public void ConfigureServices(IServiceCollection services)
        {
            // Add the Shared state to the DI container.
            services.AddSingleton <ISharedState>(x => new SharedState());

            // Add a singleton ViewStore to the DI container.
            services.AddSingleton(x =>
            {
                var vs = new ViewStore();
                ((IReactiveObject)vs).SharedState = x.GetRequiredService <ISharedState>();
                return(vs);
            });

            // Add a singleton TodoStore to the DI container.
            services.AddSingleton(x =>
            {
                var ts = new TodoStore();
                ((IReactiveObject)ts).SharedState = x.GetRequiredService <ISharedState>();
                return(ts);
            });
        }
Ejemplo n.º 4
0
 private void Awake()
 {
     _viewStore = FindObjectOfType <ViewStore>();
 }
Ejemplo n.º 5
0
 protected override void Awake()
 {
     base.Awake();
     _viewStore   = FindObjectOfType <ViewStore>();
     _cameraStore = FindObjectOfType <CameraStore>();
 }