public TripService(IApplicationDbContext dbContext, ICurrentUserService currentUserService, IDistanceCalculatorService distanceCalculatorService) {
     _dbContext = dbContext;
     if (currentUserService != null && currentUserService.UserId != null) {
         _applicationUser = _dbContext.Users.SingleOrDefault(u => u.Id == currentUserService.UserId);
     }
     _distanceCalculatorService = distanceCalculatorService;
 }
        public CommentsController(IApplicationDbContext applicationDbContext, IPostRepository postRepository,
            IUserRepository userRepository)
            : base(applicationDbContext)
        {
            _postRepository = postRepository;

            _userRepository = userRepository;
        }
 public AccountService(IApplicationDbContext dbContext, UserManager<ApplicationUser> userManager) {
     _dbContext = dbContext;
     _userManager = userManager;
     _userManager.UserValidator = new UserValidator<ApplicationUser>(_userManager) {
         AllowOnlyAlphanumericUserNames = false
     };
     _userManager.PasswordValidator = new PasswordValidator {
         RequiredLength = 6,
         RequireNonLetterOrDigit = true,
         RequireDigit = false,
         RequireLowercase = false,
         RequireUppercase = false,
     };
 }
 public AircraftTypeController(IApplicationDbContext dbContext)
 {
     db = dbContext;
 }
 protected BaseDbReadOnlyStore(IApplicationDbContext applicationDbContext)
 {
     ApplicationDbContext = applicationDbContext;
 }
 public AirportController(IApplicationDbContext dbContext)
 {
     db = dbContext;
 }
Example #7
0
 public ExportTodosQueryHandler(IApplicationDbContext context, IMapper mapper, ICsvFileBuilder fileBuilder)
 {
     _context     = context;
     _mapper      = mapper;
     _fileBuilder = fileBuilder;
 }
Example #8
0
 public EFMotionRepository(IApplicationDbContext dbContext)
 {
     this.dbContext = dbContext;
 }
Example #9
0
 public PollsController()
 {
     db = new ApplicationDbContext();
 }
 public BaseApiController(IApplicationDbContext applicationDbContext)
 {
     ApplicationDbContext = applicationDbContext;
 }
Example #11
0
 public GetTodoItemsWithPaginationQueryHandler(IApplicationDbContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
Example #12
0
 public DeleteEmployeeCommandHandler(IApplicationDbContext context, ICurrentUserService currentUserService, IIdentityService userManager)
 {
     _context            = context;
     _currentUserService = currentUserService;
     _userManager        = userManager;
 }
Example #13
0
 public GetArchivedQueryHandler(IApplicationDbContext context)
 {
     _context = context;
 }
Example #14
0
 public UsersFilterHandler(IApplicationDbContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
Example #15
0
 public DeleteFinanceYearCommandHandler(IApplicationDbContext context)
 {
     _context = context;
 }
Example #16
0
 public UpdateTodoListCommandHandler(IApplicationDbContext context)
 {
     _context = context;
 }
Example #17
0
 public UpdateListingCommandHandler(IApplicationDbContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
Example #18
0
 public HomeController(IApplicationDbContext appContext)
 {
     m_databaseContext = appContext;
 }
 public CowEventRepository(IApplicationDbContext context)
 {
     _context = context;
 }
 public TagRepository(IApplicationDbContext db)
 {
     _db = db;
 }
 public QuestionsController()
 {
     db = new ApplicationDbContext();
 }
 public DeleteTagCommandHandler(IApplicationDbContext context, IStringLocalizer <TagsResource> localizer)
 {
     _context   = context;
     _localizer = localizer;
 }
Example #23
0
 public TransactionController()
 {
     db = new ApplicationDbContext();
 }
Example #24
0
 public CreateTagCommandHandler(IApplicationDbContext context, IStringLocalizer <TagsResource> localizer, IMapper mapper)
 {
     _context   = context;
     _localizer = localizer;
     _mapper    = mapper;
 }
Example #25
0
 public SockRepository(IApplicationDbContext context)
 {
     _users = context.Users;
     _socks = context.Socks;
     _context = context;
 }
 public GetSeguimientoIndividualQueryHandler(IApplicationDbContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
 public static Address ResolveAddress(this Trip trip, IApplicationDbContext dbContext, string userId, Address address) {
     if (address != null && address.Id > 0) {
         return dbContext.Addresses.SingleOrDefault(a => a.User.Id == userId && a.Id == address.Id);
     }
     return null;
 }
Example #28
0
 public DeleteFantasyTeamHandler(IApplicationDbContext dbContext)
 {
     _dbContext = dbContext;
 }
 public SearchController(IApplicationDbContext applicationDbContext)
     : base(applicationDbContext)
 {
 }
Example #30
0
 public CreateSchoolClassCommandHandler(IApplicationDbContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
 public AircraftTypeController()
 {
     db = new ApplicationDbContext();
 }
Example #32
0
 public GetCatalogItemByIdQueryHandler(IApplicationDbContext context)
 {
     _context = context;
 }
Example #33
0
 public LikeController(IApplicationDbContext applicationDbContext, IPostRepository postRepository)
     : base(applicationDbContext)
 {
     _postRepository = postRepository;
 }
Example #34
0
 public GetObservacionQueryHandler(IApplicationDbContext context, IMapper mapper, IMediator mediator)
 {
     _context  = context;
     _mapper   = mapper;
     _mediator = mediator;
 }
 public AccountService(IApplicationDbContext dbContext)
     : this(dbContext, new UserManager<ApplicationUser>(
                             new UserStore<ApplicationUser>(
                                    (DbContext) dbContext
                             ))) {
 }
 public ReportRepository(IApplicationDbContext dbContext)
     : base(dbContext) { }
Example #37
0
 public PizzaRepository(IApplicationDbContext context)
 {
     _users = context.Users;
     _context = context;
     _pm = new List<PizzaModel>();
 }
Example #38
0
 public Handler(IApplicationDbContext context) =>
        public CategoriesModule(IApplicationDbContext ctx)
        {
            Get["/categories"] = _ =>
                {
                    var categories = ctx.Categories.ToList();
                    return View["index", categories];
                };

            Get["/category/new"] = _ =>
                {
                    var category = new Category();
                    return View["new", category];
                };

            Post["/category/new"] = parameters =>
                {
                    var category = this.Bind<Category>();
                    if (category != null)
                    {
                        ctx.Categories.Add(category);
                        ctx.SaveChanges();
                        return Response.AsRedirect("/categories");
                    }
                    return 500;
                };

            Get["/category/update/{id:guid}"] = _ =>
                {
                    var id = new Guid(_.id);
                    var category = ctx.Categories.Where(x => x.Id == id).FirstOrDefault();
                    if(category != null)
                    {
                        return View["update", new Category() { Name = category.Name, Id = category.Id}];
                    }
                    return 404;
                };

            Post["/category/update"] = parameters =>
                {
                    Category category = this.Bind<Category>();
                    if(category != null)
                    {
                        ctx.SetModified(category);
                        ctx.SaveChanges();
                        return Response.AsRedirect("/categories");
                    }
                    return 404;
                };
            Get["/category/delete/{id:guid}"] = _ =>
                {
                    var id = new Guid(_.id);
                    if (ctx.Categories.Any(x => x.Id == id))
                    {
                        ViewBag.CategoryId = id;
                        return View["delete"];
                    }
                    return 404;
                };

            Post["/category/deleteconfirmed"] = _ =>
            {
                Category category = this.Bind<Category>();
                if (category != null)
                {
                    var dbCategory = ctx.Categories.Where(x => x.Id == category.Id).FirstOrDefault();
                    ctx.Categories.Remove(dbCategory);
                    ctx.SaveChanges();
                    return Response.AsRedirect("/categories");
                }
                return 404;
            };
        }
Example #40
0
 public GetDailyTransactionDetailsQueryHandler(IApplicationDbContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
 public QuestionsController(IApplicationDbContext dbContext)
 {
     db = dbContext;
 }
Example #42
0
 public PeopleRepository(IApplicationDbContext context, IDateTimeUtil dateTimeUtil) : base(context, dateTimeUtil)
 {
 }
Example #43
0
 public PollsController(IApplicationDbContext dbContext)
 {
     db = dbContext;
 }
 public GetAllCRMTuyenDocQueryHandler(IApplicationDbContext applicationDbContext, IMapper mapper)
 {
     _applicationDbContext = applicationDbContext;
     _mapper = mapper;
 }
Example #45
0
 public TransactionController(IApplicationDbContext dbContext)
 {
     db = dbContext;
 }
 public CheckingAccountService(IApplicationDbContext dbContext)
 {
     db = dbContext;
 }
Example #47
0
 public AccountController(IApplicationDbContext<Supplier, int> suppliers, IApplicationDbContext<Contact, int> contacts)
 {
     _suppliers = suppliers;
     _contacts = contacts;
     _logger = LogManager.GetCurrentClassLogger();
 }
 public ValidationController(IApplicationDbContext dbContext)
 {
     this.dbContext = dbContext;
 }
 public DeleteAddressCommandHandler(IApplicationDbContext context)
 {
     _context = context;
 }
Example #50
0
 public CompanyRepository(IApplicationDbContext db) : base(db) { }
Example #51
0
 public PreguntasEvaluacionCommandHandler(IApplicationDbContext context, IConfiguration configuration)
 {
     _context = context;
     _config  = configuration;
 }
Example #52
0
 public CreateTodoItemCommandHandler(IApplicationDbContext context)
 {
     _context = context;
 }
 public static Car ResolveCar(this Trip trip, IApplicationDbContext dbContext, string userId, Car car) {
     if (car != null && car.Id > 0) {
         return dbContext.Cars.SingleOrDefault(c => c.User.Id == userId && c.Id == car.Id);
     }
     return null;
 }
 public UpdateContactCommandHandler(IApplicationDbContext context)
 {
     _context = context;
 }
 public AirportController()
 {
     db = new ApplicationDbContext();
 }
 public RemoveJoinRoleCommandHandler(IApplicationDbContext context)
 {
     _context = context;
 }
 public CarService(IApplicationDbContext dbContext, ICurrentUserService currentUserService) {
     _dbContext = dbContext;
     if (currentUserService != null && currentUserService.UserId != null) {
         _applicationUser = _dbContext.Users.SingleOrDefault(u => u.Id == currentUserService.UserId);
     }
 }
 public SmashAttributeTypeService(IApplicationDbContext db, IResultValidationService resultValidationService)
     : base(db, resultValidationService)
 { }
Example #59
0
 protected QueryHandlerBase(IApplicationDbContext dbContext)
 {
     _context = dbContext;
 }
Example #60
0
 public GigRepository(IApplicationDbContext context)
 {
     _context = context;
 }