コード例 #1
0
        public SqlServerStateProvider(string nameOrConnectionStr)
        {
            DbContext = new SequenceDbContext(nameOrConnectionStr);

            DbSet = DbContext.Set<SqlServerSequence>();

        }
コード例 #2
0
ファイル: TitleService.cs プロジェクト: raminmjj/Decision
 public TitleService(IUnitOfWork unitOfWork, IApplicationUserManager userManager, IMappingEngine mappingEngine)
 {
     _userManager = userManager;
     _unitOfWork = unitOfWork;
     _titles = _unitOfWork.Set<Title>();
     _mappingEngine = mappingEngine;
 }
コード例 #3
0
 public ResearchExperienceService(IUnitOfWork unitOfWork, IApplicationUserManager userManager, IMappingEngine mappingEngine)
 {
     _userManager = userManager;
     _unitOfWork = unitOfWork;
     _researchExperiences = _unitOfWork.Set<ResearchExperience>();
     _mappingEngine = mappingEngine;
 }
コード例 #4
0
ファイル: InterviewService.cs プロジェクト: rabbal/Decision
 public InterviewService(IUnitOfWork unitOfWork, IApplicationUserManager userManager, IMappingEngine mappingEngine)
 {
     _userManager = userManager;
     _unitOfWork = unitOfWork;
     _interviews = _unitOfWork.Set<Interview>();
     _mappingEngine = mappingEngine;
 }
コード例 #5
0
ファイル: SportService.cs プロジェクト: raminmjj/SportsSystem
 public SportService(IDbContext dbContext)
 {
     _dbContext = dbContext;
     _sports = dbContext.Set<Sport>();
     _sportCategories = dbContext.Set<SportCategory>();
     _sportDetails = dbContext.Set<SportDetail>();
 }
コード例 #6
0
ファイル: FakeCMSDbContext.cs プロジェクト: cashwu/testZip
 public FakeCMSDbContext()
 {
     AuthTokens = new FakeDbSet<AuthToken>();
     Barcodes = new FakeDbSet<Barcode>();
     Catalogues = new FakeDbSet<Catalogue>();
     Clients = new FakeDbSet<Client>();
     ClientAllowScopes = new FakeDbSet<ClientAllowScope>();
     ItemAttributes = new FakeDbSet<ItemAttribute>();
     ItemMasters = new FakeDbSet<ItemMaster>();
     Members = new FakeDbSet<Member>();
     MemberInRoles = new FakeDbSet<MemberInRole>();
     MemberSpecificScopes = new FakeDbSet<MemberSpecificScope>();
     Merchandises = new FakeDbSet<Merchandise>();
     Products = new FakeDbSet<Product>();
     ProductPictures = new FakeDbSet<ProductPicture>();
     Promotions = new FakeDbSet<Promotion>();
     PurchasePrices = new FakeDbSet<PurchasePrice>();
     Restructures = new FakeDbSet<Restructure>();
     Roles = new FakeDbSet<Role>();
     RoleInScopes = new FakeDbSet<RoleInScope>();
     Scopes = new FakeDbSet<Scope>();
     SubCodes = new FakeDbSet<SubCode>();
     Suppliers = new FakeDbSet<Supplier>();
     SupplierAttributes = new FakeDbSet<SupplierAttribute>();
     Sysdiagrams = new FakeDbSet<Sysdiagram>();
 }
コード例 #7
0
        public AddSubReportForm(IUnitOfWork unitOfWork,
            IShowListForCities showListForCities,IShowListForDrivers showListForDrivers, IShowListForFreights showListForFreights)
            : base(unitOfWork)
        {
            _paths = unitOfWork.Set<Path>();
            _drivers = unitOfWork.Set<Driver>();
            _freights = unitOfWork.Set<Freight>();

            _showListForCities = showListForCities;
            _showListForDrivers = showListForDrivers;
            _showListForFreights = showListForFreights;
            InitializeComponent();
            _defaultControl = pathCombo;

            pathCombo.Items.Clear();
            _pathList = _paths.Where(x => x.ActiveState).ToList();
            foreach (var tmp in _pathList.Select(path => $"{path.SourceCity} - {path.DestinationCity} :[{path.Id}]"))
                pathCombo.Items.Add(tmp);

            driverCombo.Items.Clear();
            _driverList = _drivers.Where(x => x.ActiveState).ToList();
            foreach (var tmp in
                _driverList.Select(driver => $"{driver.Name} {driver.Family} - {driver.Plaque} :[{driver.Id}]"))
                driverCombo.Items.Add(tmp);

            freightCombo.Items.Clear();
            _freightList = _freights.Where(x => x.ActiveState).ToList();
            foreach (var tmp in _freightList)
                freightCombo.Items.Add($"{tmp.Name} :[{tmp.Id}]");
        }
コード例 #8
0
 private IEnumerable<IDataUpHandler> FindExecutedRevisions(IDbSet<Revision> systemRevisions, IEnumerable<IDataUpHandler> allRevisions)
 {
     return from dataRevision in allRevisions
            let revisionType = dataRevision.GetType().FullName
            where systemRevisions.Any(x => revisionType.Equals(x.Type, StringComparison.InvariantCultureIgnoreCase))
            select dataRevision;
 }
コード例 #9
0
 public ReferentialTeacherService(IUnitOfWork unitOfWork, IApplicationUserManager userManager, IMappingEngine mappingEngine)
 {
     _userManager = userManager;
     _unitOfWork = unitOfWork;
     _referentialTeachers = _unitOfWork.Set<ReferentialTeacher>();
     _mappingEngine = mappingEngine;
 }
コード例 #10
0
 public NotificationSettingService(IUnitOfWork uow, IUserService userService, IMessagingGatewayAdapter messagingGateway)
 {
     _uow = uow;
     _notification = uow.Set<NotificationSetting>();
     _userService = userService;
     _messagingGateway = messagingGateway;
 }
コード例 #11
0
 public void SetUp()
 {
     _dbContext = Substitute.For<EfDbContext>();
     _toDoDbSet = Substitute.For<IDbSet<ToDoDto>>();
     _dbContext.ToDos = _toDoDbSet;
     _repository = new ToDoDtoRepository(_dbContext);
 }
コード例 #12
0
        public ApplicationEventRepository(DbContext context)
        {
            if (context == null) throw new ArgumentNullException("context");

            _context = context;
            _logEventEntity = _context.Set<ApplicationEvent>();
        }
コード例 #13
0
 public EntireEvaluationService(IUnitOfWork unitOfWork, IApplicationUserManager userManager, IMappingEngine mappingEngine)
 {
     _userManager = userManager;
     _unitOfWork = unitOfWork;
     _entireEvaluations = _unitOfWork.Set<EntireEvaluation>();
     _mappingEngine = mappingEngine;
 }
コード例 #14
0
ファイル: AuditLogService.cs プロジェクト: raminmjj/Decision
 public AuditLogService(IUnitOfWork unitOfWork, IApplicationUserManager userManager, IMappingEngine mappingEngine)
 {
     _userManager = userManager;
     _unitOfWork = unitOfWork;
     _logs = _unitOfWork.Set<AuditLog>();
     _mappingEngine = mappingEngine;
 }
コード例 #15
0
 public IeltsMaterialService(IUnitOfWork uow, Lazy<INotificationService> notificationService, Lazy<IFilesProxyAdapter> filesProxyAdapter)
 {
     _uow = uow;
     _IeltsMaterial = uow.Set<IeltsMaterial>();
     _notificationService = notificationService;
     _filesProxyAdapter = filesProxyAdapter;
 }
コード例 #16
0
 public ContestScore(Contest contest, IDbSet<Participant> participantList)
 {
     _contest = contest;
     ContestName = contest.Name;
     ParticipantList = participantList;
     AddParticipantScores();
 }
コード例 #17
0
 public SessionRequestService(IUnitOfWork uow, Lazy<INotificationService> notificationService, ISessionService sessionService)
 {
     _sessionService = sessionService;
     _notificationService = notificationService;
     _uow = uow;
     _sessionRequest = uow.Set<SessionRequest>();
 }
コード例 #18
0
        public LogRepository(DbContext context)
        {
            if (context == null) throw new ArgumentNullException("context");

            _context = context;
            _logEntity = _context.Set<Log>();
        }
コード例 #19
0
 public FakeNorthwindDbContext()
 {
     AlphabeticalListOfProducts = new FakeDbSet<AlphabeticalListOfProduct>();
     Categories = new FakeDbSet<Category>();
     CategorySalesFor1997 = new FakeDbSet<CategorySalesFor1997>();
     CurrentProductLists = new FakeDbSet<CurrentProductList>();
     Customers = new FakeDbSet<Customer>();
     CustomerAndSuppliersByCities = new FakeDbSet<CustomerAndSuppliersByCity>();
     CustomerDemographics = new FakeDbSet<CustomerDemographic>();
     Employees = new FakeDbSet<Employee>();
     Invoices = new FakeDbSet<Invoice>();
     Orders = new FakeDbSet<Order>();
     OrderDetails = new FakeDbSet<OrderDetail>();
     OrderDetailsExtendeds = new FakeDbSet<OrderDetailsExtended>();
     OrdersQries = new FakeDbSet<OrdersQry>();
     OrderSubtotals = new FakeDbSet<OrderSubtotal>();
     Products = new FakeDbSet<Product>();
     ProductsAboveAveragePrices = new FakeDbSet<ProductsAboveAveragePrice>();
     ProductSalesFor1997 = new FakeDbSet<ProductSalesFor1997>();
     ProductsByCategories = new FakeDbSet<ProductsByCategory>();
     Regions = new FakeDbSet<Region>();
     SalesByCategories = new FakeDbSet<SalesByCategory>();
     SalesTotalsByAmounts = new FakeDbSet<SalesTotalsByAmount>();
     Shippers = new FakeDbSet<Shipper>();
     SummaryOfSalesByQuarters = new FakeDbSet<SummaryOfSalesByQuarter>();
     SummaryOfSalesByYears = new FakeDbSet<SummaryOfSalesByYear>();
     Suppliers = new FakeDbSet<Supplier>();
     Sysdiagrams = new FakeDbSet<Sysdiagram>();
     Territories = new FakeDbSet<Territory>();
 }
コード例 #20
0
 /// <summary>
 /// Constructor that takes a MySQLDatabase instance 
 /// </summary>
 /// <param name="database"></param>
 public UserRolesTableRepository(MySQLDatabase database)
 {
     _database = database;
     //_database.Set(typeof(UserRolesTable));
     this.dbSet = database.Set<UserRolesTable>();
     this.dbSetRoles = database.Set<IdentityRole>();
 }
コード例 #21
0
 public EducationalBackgroundService(IUnitOfWork unitOfWork,
     IApplicationUserManager userManager, IMappingEngine mappingEngine)
 {
     _userManager = userManager;
     _unitOfWork = unitOfWork;
     _educationalBackgrounds = _unitOfWork.Set<EducationalBackground>();
     _mappingEngine = mappingEngine;
 }
コード例 #22
0
ファイル: QuestionService.cs プロジェクト: rabbal/Decision
 public QuestionService(IUnitOfWork unitOfWork, IAnswerOptionService answerOptionService, IApplicationUserManager userManager, IMappingEngine mappingEngine)
 {
     _userManager = userManager;
     _unitOfWork = unitOfWork;
     _questions = _unitOfWork.Set<Question>();
     _mappingEngine = mappingEngine;
     _answerOptionService = answerOptionService;
 }
コード例 #23
0
 public AnswerOptionService(IUnitOfWork unitOfWork, ITitleService titleService, IApplicationUserManager userManager, IMappingEngine mappingEngine)
 {
     _userManager = userManager;
     _unitOfWork = unitOfWork;
     _answerOptions = _unitOfWork.Set<AnswerOption>();
     _titleService = titleService;
     _mappingEngine = mappingEngine;
 }
コード例 #24
0
        public todayReportForm(IUnitOfWork uinOfWork, IAddOrEditReport addForm, IShowListForSubReports viewSubReport)
        {
            _repositoryReports = uinOfWork.Set<Report>();
            _addForm = addForm;
            _viewSubReport = viewSubReport;

            InitializeComponent();
        }
コード例 #25
0
        protected SettingsBase(IUnitOfWork unitOfWork)
        {
            _settings = unitOfWork.Set<Setting>();

            var type = GetType();
            _name = type.Name;
            _properties = type.GetProperties();
        }
コード例 #26
0
 public EducationalExperienceService(IUnitOfWork unitOfWork, ITitleService titleService, IApplicationUserManager userManager, IMappingEngine mappingEngine)
 {
     _titleService = titleService;
     _userManager = userManager;
     _unitOfWork = unitOfWork;
     _educationalExperiences = _unitOfWork.Set<EducationalExperience>();
     _mappingEngine = mappingEngine;
 }
コード例 #27
0
 public TeacherInServiceCourseTypeService(IUnitOfWork unitOfWork,ITitleService titleService, IApplicationUserManager userManager, IMappingEngine mappingEngine)
 {
     _userManager = userManager;
     _unitOfWork = unitOfWork;
     _TeacherInServiceCourseTypes = _unitOfWork.Set<TeacherInServiceCourseType>();
     _mappingEngine = mappingEngine;
     _titleService = titleService;
 }
コード例 #28
0
 public RoleManagementService(IUnitOfWork uow, ICacheProvider cache)
 {
     _uow = uow;
     _role = uow.Set<Role>();
     _userInRole = uow.Set<UserInRole>();
     _actionRole = uow.Set<ActionRole>();
     _cache = cache;
 }
コード例 #29
0
ファイル: AppraiserService.cs プロジェクト: raminmjj/Decision
 public AppraiserService(IUnitOfWork unitOfWork, ITitleService titleService, IApplicationUserManager userManager, IMappingEngine mappingEngine)
 {
     _userManager = userManager;
     _unitOfWork = unitOfWork;
     _appraisers = _unitOfWork.Set<Appraiser>();
     _titleService = titleService;
     _mappingEngine = mappingEngine;
 }
コード例 #30
0
        public EFWorkExperienceRepository(IUnitOfWork uow)
        {
            _uow = uow;

            _RWorkExperienceGroup = _uow.Set<WorkExperienceGroup>();
            _RWorkExperience = _uow.Set<WorkExperience>();
            _RWorkExperienceGallery = _uow.Set<WorkExperienceGallery>();
        }
コード例 #31
0
 public BaseService(IUnitOfWork unitOfWork, IMapper mapper)
 {
     _unitOfWork = unitOfWork;
     _mapper     = mapper;
     _entities   = _unitOfWork.Set <TEntity>();
 }
コード例 #32
0
 public GenericRepository(SampleContext context)
 {
     _context = context;
     _dbSet   = context.Set <T>();
 }
コード例 #33
0
 public GenericRepository(DbContext context)
 {
     this.context = context;
     this.set     = context.Set <T>();
 }
コード例 #34
0
ファイル: EfEntityStorage.cs プロジェクト: vbogretsov/academy
 protected T Get <T>(int entityId, IDbSet <T> entities)
     where T : Entity
 {
     return(entities.SingleOrDefault(x => x.Id == entityId));
 }
コード例 #35
0
 protected BaseRepository(RMContext context)
 {
     dataContext = context;
     dbSet       = context.Set <T>();
 }
コード例 #36
0
 public GenericRepository(DbContext context)
 {
     _entities = context;
     _dbset    = context.Set <T>();
 }
コード例 #37
0
 public StatisticsService(IUnitOfWork uow)
 {
     _statistics = uow.Set <Statistics>();
     _countries  = uow.Set <Country>();
 }
コード例 #38
0
 public RepositoryBase(mysqlpiContext context)
 {
     this.context = context;
     dbset        = context.Set <T>();
 }
コード例 #39
0
 public EFRepository(DbContext dbContext)
 {
     _dbContext = dbContext;
     set        = dbContext.Set <T>();
 }
コード例 #40
0
 public PermissionService(IUnitOfWork2 unitOfWork, ICustomCache <string, IEnumerable <string> > permissionsCache)
 {
     _permissionsDbSet = unitOfWork.GetDbSet <Permission>();
     _permissionsCache = permissionsCache;
 }
コード例 #41
0
 protected Repository(IDbFactory dbFactory)
 {
     DbFactory = dbFactory;
     dbset     = Context.Set <T>();
 }
コード例 #42
0
 protected GenericRepository(DbContext context)
 {
     Entities = context;
     Dbset    = context.Set <T>();
 }
コード例 #43
0
 public BaseRepository(IDbContext context)
 {
     Context    = context;
     this.DbSet = Context.Set <TEntity>();
 }
コード例 #44
0
 public Repository(ContosoDbContext context)
 {
     _context = context;
     dbSet    = context.Set <T>();
 }
コード例 #45
0
 public StockRepository(StockContext context)
 {
     _context = context;
     _dataSet = _context.Set <T>();
 }
コード例 #46
0
 public BugsRepository(BugLoggerDbContext bugLoggerContext)
 {
     this.dbContext = bugLoggerContext;
     this.set       = bugLoggerContext.Set <Bug>();
 }
コード例 #47
0
 public Role_UserRepository()
 {
     _APPContext = ApplicationContext.getInstance();
     _DbSet      = _APPContext.Set <Role_User>();
 }
コード例 #48
0
 private NetSqlQueryable(IDbSet dbSet, QueryBody queryBody) : base(dbSet, queryBody)
 {
 }
コード例 #49
0
 public ScoreTitleService(IUnitOfWork unitOfWork)
 {
     _unitOfWork = unitOfWork;
     _ScoreTitle = _unitOfWork.Set <ScoreTitle>();
 }
コード例 #50
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="context">Object context</param>
 public Repository(DemographicsDbContext context)
 {
     _context    = context;
     this._dbSet = _context.Set <T>();
 }
コード例 #51
0
ファイル: TagService.cs プロジェクト: EbrahimHamzeh/Yeast.Web
 public TagService(IUnitOfWork uow)
 {
     _tags = uow.Set <Tag>();
 }
コード例 #52
0
 protected RepositoryBase(IDbFactory dbFactory)
 {
     DbFactory = dbFactory;
     dbSet     = DbContext.Set <T>();
 }
コード例 #53
0
ファイル: EfEntityStorage.cs プロジェクト: vbogretsov/academy
 protected void Add <T>(T entity, IDbSet <T> entities)
     where T : Entity
 {
     entities.Add(entity);
     Commit();
 }
コード例 #54
0
 public static IEFBatchOperationBase <TContext, T> For <TContext, T>(TContext context, IDbSet <T> set)
     where TContext : DbContext
     where T : class
 {
     return(EFBatchOperation <TContext, T> .For(context, set));
 }
コード例 #55
0
 public Repository(IDbContext context)
 {
     _context = context;
     _dbSet   = context.Set <TEntity>();
 }
コード例 #56
0
 public static void SeedEnumValues <T, TEnum>(this IDbSet <T> dbSet, Func <TEnum, T> converter)
     where T : class => Enum.GetValues(typeof(TEnum))
 .Cast <object>()
 .Select(value => converter((TEnum)value))
 .ToList()
 .ForEach(instance => dbSet.AddOrUpdate(instance));
コード例 #57
0
 protected RepositoryBase()
 {
     DbFactory = new DbFactory();
     dbSet     = DbContext.Set <T>();
 }
コード例 #58
0
 public GenericRepository(MonolithDbContext unitOfWork)
 {
     _context = unitOfWork;
     _dbSet   = _context.Set <T>();
 }
コード例 #59
0
 public Repository(HospitalContext context)
 {
     _context = context;
     _dbSet   = _context.Set <T>();
 }
コード例 #60
0
 public VacationPageService(IUnitOfWork2 uow, IMapper mapper)
 {
     _vacationPagesDbSet = uow.GetDbSet <VacationPage>();
     _mapper             = mapper;
     _uow = uow;
 }