public void can_map_with_projection() { using (var db = new ApplicationDBContext()) { var result = db.Parents.ProjectTo<ParentVM>(Configuration); } }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); System.Web.HttpContext.Current.Application["OnlaynUsers"] = 0; Database.SetInitializer(new DBInitalazer()); using (var db = new ApplicationDBContext()) { db.Database.Initialize(true); } }
// GET: Default public async Task<ActionResult> Index() { if (User.Identity.IsAuthenticated) { using (ApplicationDBContext db = new ApplicationDBContext()) { var UM = new ApplicationManager(new UserStore<ApplicationUser>(db)); var user = await UM.FindByNameAsync(User.Identity.Name); ViewBag.Age = user?.Year; ViewBag.Sex = user?.Sex; } } return View(); }
public void OnActionExecuting(ActionExecutingContext filterContext) { using (var transaction = new System.Transactions.TransactionScope()) { using (var db = new ApplicationDBContext()) { var url = filterContext.RequestContext.HttpContext.Request.RawUrl.ToString(); VisitsTable vt = db.Visits.Find(url); if (vt == null) { vt = new VisitsTable { Url = url, Count = 1 }; db.Visits.Add(vt); } else { vt.Count = vt.Count+ 1; } db.SaveChanges(); } transaction.Complete(); } }
public HomeController(ApplicationDBContext database) { this.database = database; }
public UserController(ApplicationDBContext unitOfWork) { _unitOfWork = unitOfWork; }
public UserResponseRepository(ApplicationDBContext context) : base(context) { }
public AlbumRepository(ApplicationDBContext context) { _context = context; // _albums = context.Albums; }
public TournamentService(ApplicationDBContext context, DataService dataService, ILogger <TournamentService> logger) { _context = context; _dataService = dataService; _logger = logger; }
public CommentRepository(ApplicationDBContext dBContext) { _dBContext = dBContext; }
public TicketStatusService(ApplicationDBContext db, IMapper mapper) : base(db, mapper) { }
public GetCurrencies(ApplicationDBContext context) { Context = context; }
public RolesController(ApplicationDBContext db) => _RoleStore = new RoleStore <IdentityRole>(db);
public MakeRepository(ApplicationDBContext context) : base(context) { }
public EmployeeController(ApplicationDBContext context) { _context = context; }
public BadgeRepository(ApplicationDBContext context) { _badges = context.Badges; _context = context; }
public ToChucController(ILogger <ToChucController> logger, ApplicationDBContext context) { _logger = logger; _context = context; }
public UsuariosController(ApplicationDBContext context, UserManager <ApplicationUser> userManager) { this.context = context; this.userManager = userManager; }
public HomeController(ILogger <HomeController> logger, ApplicationDBContext dbContext, IWebHostEnvironment env) { _logger = logger; this.dbContext = dbContext; this.env = env; }
public SqlUploadedFileRepository(ApplicationDBContext dBContext) { this.dBContext = dBContext; }
public CongTrinhKhaiThacController(ILogger <CongTrinhKhaiThacController> logger, ApplicationDBContext context) { _logger = logger; _context = context; }
public UserService(ApplicationDBContext context) { _context = context; }
public EditModel(ApplicationDBContext db) { _db = db; }
public BaseService(ApplicationDBContext db, IMapper mapper) { this.db = db; this.mapper = mapper; }
public ChangePasswordHandler(ApplicationDBContext appDBContext, IHttpContextAccessor httpContextAccessor) { _appDBContext = appDBContext; _httpContextAccessor = httpContextAccessor; }
public RepositoryFilm(ApplicationDBContext _database) { database = _database; }
public EmailService(ApplicationDBContext context) { db = context; }
public SeedUser(ApplicationDBContext context) { _context = context; }
public Covid_status1Controller(ApplicationDBContext context) { _context = context; }
public ProjectRepository() { db = new ApplicationDBContext(); }
public RecieptRepository() { db = new ApplicationDBContext(); }
public PaymentVoucherRepository() { db = new ApplicationDBContext(); }
public GenericRepository(ApplicationDBContext context) { _context = context; }
public RequestTypeService(ApplicationDBContext context) { _context = context; }
public Create_userModel(ApplicationDBContext db) { _db = db; }
public IndexModel(ApplicationDBContext db) { _db = db; }
public CityService(ApplicationDBContext context) { _context = context; }