protected void Application_EndRequest(Object sender, EventArgs e) { IStoreDB db = DependencyResolver.Current.GetService <IStoreDB>(); db.SaveChanges(); db.Dispose(); }
public void Start(HttpContext context, IStoreDB db) { this._db = db; this._httpContext = context; HttpCookie cookie = context.Request.Cookies[COOKIE_NAME]; if (cookie != null && !string.IsNullOrEmpty(cookie.Value)) { FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(cookie.Value); this._user = db.GetUser(ticket.Name); if (this.User != null) { this.IsAuthentication = true; } else { this.DeleteCookies(); this.IsAuthentication = false; } } }
public ProductService(IStoreDB db) { _db=db; }
public void Start(HttpContext context, IStoreDB db) { this._db = db; this._httpContext = context; HttpCookie cookie = context.Request.Cookies[COOKIE_NAME]; if (cookie != null && !string.IsNullOrEmpty(cookie.Value)) { FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(cookie.Value); this._user = db.GetUser(ticket.Name); if (this.User != null) this.IsAuthentication = true; else { this.DeleteCookies(); this.IsAuthentication = false; } } }
public PictureService(IStoreDB db) { _db = db; }
public ProducerService(IStoreDB db) { _db = db; }
public GetOrdersController(IStoreDB storeDBParam) { istoreDB = storeDBParam; }