public EfCoreRepositoryTests(EfCoreDbcontextFixture fixture, ITestOutputHelper output) { _fixture = fixture; _output = output; _unitOfWork = _fixture.Container.Resolve<IUnitOfWork>(); _userContext = _fixture.Container.Resolve<UserContext>(); _cusRsp = _fixture.Container.Resolve<IEfRepository<Customer>>(); _cusFinanceRsp = _fixture.Container.Resolve<IEfRepository<CusFinance>>(); _cusLogsRsp = _fixture.Container.Resolve<IEfRepository<CusTransactionLog>>(); Initialize().Wait(); }
public UserAppService(IMapper mapper, IEfRepository <SysUser> userRepository, IDeptAppService deptAppService, IRoleAppService roleAppService, UsrManager usrManager) { _mapper = mapper; _userRepository = userRepository; _deptAppService = deptAppService; _roleAppService = roleAppService; _usrManager = usrManager; }
public UserAppService(IMapper mapper, IEfRepository <SysUser> userRepository, IEfRepository <SysDept> deptRepository, IEfRepository <SysRole> roleRepository, ISystemManagerService systemManagerService) { _mapper = mapper; _userRepository = userRepository; _deptRepository = deptRepository; _roleRepository = roleRepository; _systemManagerService = systemManagerService; }
public MaxscaleTests(MaxscaleDbcontextFixture fixture, ITestOutputHelper output) { _fixture = fixture; _output = output; _unitOfWork = _fixture.Container.Resolve <IUnitOfWork>(); _userContext = _fixture.Container.Resolve <IOperater>(); _cusRsp = _fixture.Container.Resolve <IEfRepository <Customer> >(); _cusFinanceRsp = _fixture.Container.Resolve <IEfRepository <CustomerFinance> >(); _cusLogsRsp = _fixture.Container.Resolve <IEfRepository <CustomerTransactionLog> >(); Initialize(); }
public AccountAppService(IEfRepository <SysUser> userRepository , IEfRepository <SysRole> roleRepository , IEfRepository <SysMenu> menuRepository , RabbitMqProducer mqProducer , CacheService cacheService) { _userRepository = userRepository; _roleRepository = roleRepository; _menuRepository = menuRepository; _mqProducer = mqProducer; _cacheService = cacheService; }
public SelectOptionsController(IEfRepository <Participant> repository , ISelectOptionService selectOptionService , IEfRepository <Event> eventRepository , IMapper mapper , IEfRepository <Guest> guestRepository) { _repository = repository; _selectOptionService = selectOptionService; _eventRepository = eventRepository; _mapper = mapper; _guestRepository = guestRepository; }
public UserAppService(IMapper mapper, IEfRepository <SysUser> userRepository, IEfRepository <SysDept> deptRepository, IEfRepository <SysRole> roleRepository, IUsrManagerService usrManager) { _mapper = mapper; _userRepository = userRepository; _deptRepository = deptRepository; _roleRepository = roleRepository; _usrManager = usrManager; }
public UserAppService( IEfRepository <SysUser> userRepository , IEfRepository <SysRole> roleRepository , IEfRepository <SysMenu> menuRepository , CacheService cacheService , BloomFilterFactory bloomFilterFactory) { _userRepository = userRepository; _roleRepository = roleRepository; _menuRepository = menuRepository; _cacheService = cacheService; _bloomFilterFactory = bloomFilterFactory; }
public DeptAppService(IMapper mapper , IHybridProviderFactory hybridProviderFactory , IEasyCachingProviderFactory simpleProviderFactory , IEfRepository <SysDept> deptRepository , ISystemManagerService systemManagerService) { _mapper = mapper; _cache = hybridProviderFactory.GetHybridCachingProvider(EasyCachingConsts.HybridCaching); _locaCahce = simpleProviderFactory.GetCachingProvider(EasyCachingConsts.LocalCaching); _redisCache = simpleProviderFactory.GetCachingProvider(EasyCachingConsts.RemoteCaching); _deptRepository = deptRepository; _systemManagerService = systemManagerService; }
public EfController( ILogger <DBLogger> logger, IEfRepository <Book> bookRepository, IEfRepository <Author> authorRepository, IEfRepository <Tag> tagRepository, IEfRepository <BookTag> bookTagRepository) { _logger = logger; _bookRepository = bookRepository; _authorRepository = authorRepository; _tagRepository = tagRepository; _bookTagRepository = bookTagRepository; }
/// <summary> /// 商品管理构造函数 /// </summary> /// <param name="productRepo"></param> /// <param name="warehouseInfoRepo"></param> /// <param name="maintRpcSrv"></param> /// <param name="productMgr"></param> /// <param name="mapper"></param> public ProductAppService( IEfRepository <Product> productRepo , IEfRepository <WarehouseInfo> warehouseInfoRepo , IMaintRpcService maintRpcSrv , ProductManager productMgr , IMapper mapper) { _productMgr = productMgr; _productRepo = productRepo; _warehouseInfoRepo = warehouseInfoRepo; _maintRpcSrv = maintRpcSrv; _mapper = mapper; }
public MaxscaleTests(MaxscaleDbcontextFixture fixture, ITestOutputHelper output) { _fixture = fixture; _output = output; _unitOfWork = _fixture.Container.GetRequiredService <IUnitOfWork>(); _cusRsp = _fixture.Container.GetRequiredService <IEfRepository <Customer> >(); _cusFinanceRsp = _fixture.Container.GetRequiredService <IEfRepository <CustomerFinance> >(); _cusLogsRsp = _fixture.Container.GetRequiredService <IEfRepository <CustomerTransactionLog> >(); if (IdGenerater.CurrentWorkerId < 0) { IdGenerater.SetWorkerId(1); } }
public RestaurantService( IEfRepository <Restaurant> restaurantRepository, IEfRepository <User> userRepository, IEfRepository <Table> tableRepository, IUserRoleService userRoleService, ISaveContext saveContext) { this.restaurantRepository = restaurantRepository; this.userRepository = userRepository; this.tableRepository = tableRepository; this.userRoleService = userRoleService; this.saveContext = saveContext; }
public UsrManagerService(IEfRepository <SysUser> userRepository , IEfRepository <SysUserFinance> financeRepository , IEfRepository <SysRelation> relationRepository , IEfRepository <SysMenu> menuRepository , IEfRepository <SysDept> deptRepository ) { _userRepository = userRepository; _financeRepository = financeRepository; _relationRepository = relationRepository; _menuRepository = menuRepository; _deptRepository = deptRepository; }
public void ThrowsArgumentNullException_WhenChallengesRepository_IsNull() { // Arrange var submisionsRepoFake = new Mock <IEfRepository <Submission> >();; IEfRepository <Challenge> challengeRepo = null; var efData = new Mock <IEfData>(); var timeFake = new Mock <ITimeProvider>(); var mapperFake = new Mock <IMappingProvider>(); // Act and Assert Assert.Throws <ArgumentNullException>(() => new SubmissionsService(submisionsRepoFake.Object, challengeRepo, efData.Object, timeFake.Object, mapperFake.Object)); }
public static async Task <List <SysMenu> > GetMenusByRoleIdsAsync(this IEfRepository <SysMenu> repo, long[] roleIds, bool enabledOnly) { var query = repo.GetAll <SysRelation>().Where(r => roleIds.Contains(r.RoleId)) .Select(u => new { u.Menu }); if (enabledOnly) { query = query.Where(r => r.Menu.Status); } var relations = await query.ToListAsync(); return(relations.Select(d => d.Menu).Distinct().ToList()); }
public ParticipantsController(IParticipantService service , IEfRepository <Participant> repository , IPasswordHasher passwordHasher , IWebHostEnvironment hostEnvironment , IImageHelper imageHelper , IMapper mapper) { _service = service; _repository = repository; _passwordHasher = passwordHasher; _hostEnvironment = hostEnvironment; _imageHelper = imageHelper; _mapper = mapper; }
public UserService( IEfRepository <User> usersRepo, ISaveContext context, IRoleService roleService ) { Guard.WhenArgument(usersRepo, "usersRepo").IsNull().Throw(); Guard.WhenArgument(context, "context").IsNull().Throw(); Guard.WhenArgument(roleService, "roleService").IsNull().Throw(); this.roleService = roleService; this.usersRepo = usersRepo; this.context = context; }
public AccountAppService(IMapper mapper, IEfRepository <SysUser> userRepository, IEfRepository <SysRole> roleRepository, IEfRepository <SysMenu> menuRepository, IEfRepository <NullEntity> rsp, RabbitMqProducer mqProducer) { _mapper = mapper; _userRepository = userRepository; _roleRepository = roleRepository; _menuRepository = menuRepository; _rsp = rsp; _mqProducer = mqProducer; }
public ReportsController(IReportSuiteRepository reportSuiteSqlRepository , IEfRepository <ReportSuite> reportSuiteRepository , IEfRepository <ReportSuiteExternalSetup> reportSuiteExternalSetupRepository , IEfRepository <ReportSuiteColumnValue> reportSuiteColumnValueRepository , RDLReportDocument reportDocument , IMapper mapper) { _reportSuiteSqlRepository = reportSuiteSqlRepository; _reportSuiteRepository = reportSuiteRepository; _reportSuiteExternalSetupRepository = reportSuiteExternalSetupRepository; _reportSuiteColumnValueRepository = reportSuiteColumnValueRepository; _reportDocument = reportDocument; _mapper = mapper; }
public RoleAppService(IMapper mapper, IEfRepository <SysRole> roleRepository, IEfRepository <SysUser> userRepository, IEfRepository <SysRelation> relationRepository, IUsrManagerService systemManagerService, IHybridProviderFactory hybridProviderFactory) { _mapper = mapper; _roleRepository = roleRepository; _userRepository = userRepository; _systemManagerService = systemManagerService; _relationRepository = relationRepository; _cache = hybridProviderFactory.GetHybridCachingProvider(EasyCachingConsts.HybridCaching); }
private static async Task <PaginatedItem <TResponse> > GetDataAsync <TDbContext, TEntity, TResponse>( IEfRepository <TDbContext, TEntity> repo, Criterion criterion, Expression <Func <TEntity, TResponse> > selector, Expression <Func <TEntity, bool> > filter = null, params Expression <Func <TEntity, object> >[] includeProperties) where TDbContext : DbContext where TEntity : EntityBase { if (criterion.PageSize < 1 || criterion.PageSize > criterion.DefaultPagingOption.PageSize) { criterion.SetPageSize(criterion.DefaultPagingOption.PageSize); } var queryable = repo.DbContext.Set <TEntity>() as IQueryable <TEntity>; var totalRecord = await queryable.CountAsync(); var totalPages = (int)Math.Ceiling((double)totalRecord / criterion.PageSize); foreach (var includeProperty in includeProperties) { queryable = queryable.Include(includeProperty); } if (filter != null) { queryable = queryable.Where(filter); } if (!string.IsNullOrWhiteSpace(criterion.SortBy)) { var isDesc = string.Equals(criterion.SortOrder, "desc", StringComparison.OrdinalIgnoreCase) ? true : false; queryable = queryable.OrderByPropertyName(criterion.SortBy, isDesc); } if (criterion.CurrentPage > totalPages) { criterion.SetCurrentPage(totalPages); } var results = await queryable .Skip(criterion.CurrentPage *criterion.PageSize) .Take(criterion.PageSize) .AsNoTracking() .Select(selector) .ToListAsync(); return(new PaginatedItem <TResponse>(totalRecord, totalPages, results)); }
public BreweryService(IEfRepository <Brewery> breweryRepository, IEfRepository <Beer> beerRepository) { if (breweryRepository == null) { throw new ArgumentNullException(nameof(breweryRepository)); } if (beerRepository == null) { throw new ArgumentNullException(nameof(beerRepository)); } this.beerRepository = beerRepository; this.breweryRepository = breweryRepository; }
public BasicCrudInteractor( IMediator mediator, IOptions <PagingOption> pagingOption, IEfRepository <BlogDbContext, Core.Domain.Blog> blogRepository, IValidator <CreateBlogRequest> createItemValidator, IValidator <UpdateBlogRequest> updateItemValidator, IValidator <DeleteBlogRequest> deleteItemValidator) { _blogRepository = blogRepository; _mediator = mediator; _pagingOption = pagingOption; _createItemValidator = createItemValidator; _updateItemValidator = updateItemValidator; _deleteItemValidator = deleteItemValidator; }
//private readonly IdentityClaimsProfileService _identityService; public PortfolioController(IEfRepository <Project> projectRepository , ILogger <PortfolioController> logger , IMapper mapper , ICommonHelpers commonHelpers , IFormFileProcessor formFileProcessor //, IdentityClaimsProfileService identityService ) { _projectRepository = projectRepository; _logger = logger; _mapper = mapper; _commonHelpers = commonHelpers; _formFileProcessor = formFileProcessor; //_identityService = identityService; }
public PageDataQueryAppService( IObjectMapper objectMapper, PageDataManager pageDataManager, IEfRepository <ContentComponentData, int> componentDataRepository, IAbpSession abpSession ) { _objectMapper = objectMapper; _pageDataManager = pageDataManager; _componentDataRepository = componentDataRepository; _abpSession = abpSession; }
public CompaniesService(IEfRepository <Company> repository, IImageService imageService) { if (repository == null) { throw new ArgumentException("IEfRepository in company service is null."); } if (imageService == null) { throw new ArgumentException("imageservice"); } this.repository = repository; this.imageService = imageService; }
public TopBeersService(IEfRepository <BeerReview> reviewsRepository, IRankCalculationStrategy strategy) { if (reviewsRepository == null) { throw new ArgumentNullException(nameof(reviewsRepository)); } if (strategy == null) { throw new ArgumentNullException(nameof(strategy)); } this.strategy = strategy; this.reviewsRepository = reviewsRepository; }
public static async Task <TDeleteItemResponse> DeleteItemFlowAsync <TDbContext, TEntity, TDeleteItemResponse>( this IEfRepository <TDbContext, TEntity> repo, Guid id, Func <TEntity, TDeleteItemResponse> mapResponseFunc, Action <TEntity> raiseEventAction = null, params Expression <Func <TEntity, object> >[] includes) where TEntity : EntityBase where TDbContext : DbContext { var item = await repo.GetByIdAsync(id, includes); var itemDeleted = await repo.DeleteAsync(item); raiseEventAction?.Invoke(itemDeleted); return(mapResponseFunc(itemDeleted)); }
public static async Task <TCreateItemResponse> CreateItemFlowAsync <TDbContext, TEntity, TCreateItemRequest, TCreateItemResponse>( this IEfRepository <TDbContext, TEntity> repo, TCreateItemRequest request, Func <TCreateItemRequest, TEntity> mapCreateItemFunc, Func <TEntity, TCreateItemResponse> mapResponseFunc, Action <TEntity> raiseEventAction = null) where TEntity : EntityBase where TDbContext : DbContext where TCreateItemRequest : UseCase.IRequest <TCreateItemResponse> { var createEntity = mapCreateItemFunc(request); var entityCreated = await repo.AddAsync(createEntity); raiseEventAction?.Invoke(entityCreated); return(mapResponseFunc(entityCreated)); }
public MealsRepository(IEfRepository efRepository) { _efRepository = efRepository; }
public TestApplicationService(IEfRepository<Students> studentRepository, IUnitOfWorkManager uowManger,ILogger logger) { _studentRepository = studentRepository; _uowManger = uowManger; _logger = logger; }
/// <summary> /// /// </summary> public ProductsController(IEfRepository<DAL.Product> repository) { Repository = repository; }
public TestApplicationBiz(IEfRepository<Students> studentRepository, IUnitOfWorkManager uowManger) { _studentRepository = studentRepository; _uowManger = uowManger; }
public LogRepository(IEfRepository efRepository) { _efRepository = efRepository; }