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); }
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)); }
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); }); }
private void Awake() { _viewStore = FindObjectOfType <ViewStore>(); }
protected override void Awake() { base.Awake(); _viewStore = FindObjectOfType <ViewStore>(); _cameraStore = FindObjectOfType <CameraStore>(); }