当前位置: 首页>>代码示例>>C#>>正文


C# IUnitOfWork.GetRepository方法代码示例

本文整理汇总了C#中IUnitOfWork.GetRepository方法的典型用法代码示例。如果您正苦于以下问题:C# IUnitOfWork.GetRepository方法的具体用法?C# IUnitOfWork.GetRepository怎么用?C# IUnitOfWork.GetRepository使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IUnitOfWork的用法示例。


在下文中一共展示了IUnitOfWork.GetRepository方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UserService

 public UserService(IUnitOfWork uow)
 {
     this.uow = uow;
     this.userRepo = uow.GetRepository<DalUser>();
     this.userSkillRepo = uow.GetRepository<DalUserSkill>();
     this.filterRepo = uow.GetRepository<DalFilter>();
 }
开发者ID:Dragsaw,项目名称:BreadPunter,代码行数:7,代码来源:UserService.cs

示例2: ArticleService

 public ArticleService(IUnitOfWork unitOfWork)
 {
     if (unitOfWork == null) throw new ArgumentNullException("unitOfWork");
     _unitOfWork = unitOfWork;
     _articleRepository = _unitOfWork.GetRepository<DalArticleEntity>();
     _tagRepository = _unitOfWork.GetRepository<DalTagEntity>();
 }
开发者ID:gewandt,项目名称:PersonalBlog,代码行数:7,代码来源:ArticleService.cs

示例3: CommentService

 public CommentService(IUnitOfWork unitOfWork)
 {
     if (unitOfWork == null) throw new ArgumentNullException("unitOfWork");
     _unitOfWork = unitOfWork;
     _commentRepository = _unitOfWork.GetRepository<DalCommentEntity>();
     _articleRepository = _unitOfWork.GetRepository<DalArticleEntity>();
     _userRepository = _unitOfWork.GetRepository<DalUserEntity>();
 }
开发者ID:gewandt,项目名称:PersonalBlog,代码行数:8,代码来源:CommentService.cs

示例4: AjustPriceService

        public AjustPriceService(IUnitOfWork UnitOfWork)
        {
            unitofwork = UnitOfWork;

            headeRepo = unitofwork.GetRepository<ajustpriceheadeDto>();

            detailRepo = unitofwork.GetRepository<ajustpricedetailDto>();
        }
开发者ID:94hutu,项目名称:Hyde,代码行数:8,代码来源:AjustPriceService.cs

示例5: CoursesServiceProvider

        public CoursesServiceProvider(IUnitOfWork uow)
        {
            _uow = uow;

            _courseInstances      = _uow.GetRepository<CourseInstance>();
            _courseTemplates      = _uow.GetRepository<CourseTemplate>();
            _teacherRegistrations = _uow.GetRepository<TeacherRegistration>();
            _persons              = _uow.GetRepository<Person>();
        }
开发者ID:konnigud,项目名称:RESTAssignment4,代码行数:9,代码来源:CoursesServiceProvider.cs

示例6: BankCardController

        public BankCardController()
        {
            unitOfWork = new InMemoryUnitOfWork(MvcApplication.DataStore);
            var accountRepository = unitOfWork.GetRepository<Account>();
            var clientModule = new ClientModule(unitOfWork.GetRepository<Client>());
            var transactionModule = new TransactionModule(unitOfWork.GetRepository<Transaction>());

            bankCardModule = new BankCardModule(unitOfWork.GetRepository<BankCard>());
            accountModule = new AccountModule(accountRepository, bankCardModule, transactionModule, clientModule);
        }
开发者ID:AdrianFreemantle,项目名称:clientele-training,代码行数:10,代码来源:BankCardController.cs

示例7: UserService

        public UserService(IUnitOfWork unitOfWork)
        {
            _userRepository = unitOfWork.GetRepository<IUserRepository>();

            _userRepository.OnAdd += UserRepositoryOnOnAdd;

            _reportRepository = unitOfWork.Get<ReportModel>();
            _userReportRepository = unitOfWork.Get<UserReport>();
            _keyRepository = unitOfWork.Get<HashKey>();
            _employeeRepository = unitOfWork.GetRepository<IEmployeeRepository>();

            _unitOfWork = unitOfWork;
        }
开发者ID:hansel0691,项目名称:VirtualOffice,代码行数:13,代码来源:UserService.cs

示例8: FinanceControllerTests

        public FinanceControllerTests()
        {
            _unitOfWork = new UnitOfWorkMock();
            _controller = new FinanceController(_unitOfWork);

            _currentUser = new User {UserName = "currentuser"};
            _currentUserProfile = new UserProfile {User = _currentUser};

            _unitOfWork.GetRepository<User>().Insert(_currentUser);
            _unitOfWork.GetRepository<UserProfile>().Insert(_currentUserProfile);
            _unitOfWork.Save();

            _controller.ControllerContext = CreateControllerContext(_currentUser);
        }
开发者ID:MaratFatkullin,项目名称:Delusion,代码行数:14,代码来源:FinanceControllerTests.cs

示例9: AuthenticationService

 public AuthenticationService(IUnitOfWork unitOfWork, ILogger logger)
     : base(logger)
 {
     this.unitOfWork = unitOfWork;
     this.logger = logger;
     userRepository = unitOfWork.GetRepository<User>();
 }
开发者ID:nghiemhd,项目名称:Projects,代码行数:7,代码来源:AuthenticationService.cs

示例10: WorkflowUserService

        public WorkflowUserService(
            IUnitOfWork unitOfWork)
        {

            if (_manager == null)
            {
                var repository = unitOfWork.GetRepository<User>();

                var user = repository.Find(x => x.Login == "WorkflowManager");
                if (user == null)
                {
                    user = new User
                    {
                        Login = "WorkflowManager",
                        CategoryID = 1,
                        Roles = new List<Role> {
                            new Role {
                                ChildRoles = new List<ChildRole>(),
                                Permissions = new List<Permission>(),
                                Name = "WorkflowManagerRole",
                                SystemRole = SystemRole.Admin
                            }
                        },
                        FirstName = "Менеджер бизнес-процессов"
                    };

                    repository.Create(user);
                    unitOfWork.SaveChanges();
                }

                _manager = new SecurityUser(user);
            }
        }
开发者ID:altaricka,项目名称:vDesign,代码行数:33,代码来源:WorkflowUserService.cs

示例11: OrderService

 public OrderService(IUnitOfWork unitOfWork, IInventoryRepository inventoryRepository)
 {
     _unitOfWork = unitOfWork;
     _inventoryRepository = inventoryRepository;
     _orderRepository = unitOfWork.Get<Order>();
     _userRepository = unitOfWork.GetRepository<IUserRepository>();
 }
开发者ID:hansel0691,项目名称:VirtualOffice,代码行数:7,代码来源:OrderService.cs

示例12: GeographicRouteLocator

 public GeographicRouteLocator(IGeocodeService geocodeService, IUnitOfWork unitOfWork)
 {
     if (geocodeService == null) throw new ArgumentNullException("geocodeService");
     if (unitOfWork == null) throw new ArgumentNullException("unitOfWork");
     _geocodeService = geocodeService;
     _routeRepository = unitOfWork.GetRepository<Route>();
 }
开发者ID:JamesRandall,项目名称:CycleCycleCycle.com,代码行数:7,代码来源:GeographicRouteLocator.cs

示例13: ReportService

 public ReportService(IReportExecuter reportExecuter, IUnitOfWork unitOfWork)
 {
     _reportExecuter = reportExecuter;
     _unitOfWork = unitOfWork;
     _reportRepository = unitOfWork.Get<ReportModel>();
     _userReportRepository = unitOfWork.Get<UserReport>();
     _userRepository = unitOfWork.GetRepository<IUserRepository>();
 }
开发者ID:hansel0691,项目名称:VirtualOffice,代码行数:8,代码来源:ReportService.cs

示例14: NoteService

        /// <summary>
        ///   Constructs a Note Service that will use the specified
        ///   <see cref = "IUnitOfWork"></see>
        ///   to retrieve data
        /// </summary>
        /// <param name = "unitOfWork">The <see cref = "IUnitOfWork"></see>
        ///   to use to retrieve data</param>
        public NoteService(IUnitOfWork unitOfWork)
        {
            //Contract
            Requires.NotNull(unitOfWork);

            _unitOfWork = unitOfWork;
            _repository = _unitOfWork.GetRepository<Note>();
        }
开发者ID:cnurse,项目名称:FamilyTreeProject.DomainServices,代码行数:15,代码来源:NoteService.cs

示例15: TokenService

        public TokenService(IHashProvider hashProvider, IUnitOfWork unitOfWork)
        {
            _hashProvider = hashProvider;
            _tokenRespository = unitOfWork.GetRepository<ITokenRepository>();

            _tokenRespository.OnAdd += (sender, args) => unitOfWork.Commit();
            _tokenRespository.OnDelete += (sender, args) => unitOfWork.Commit();
        }
开发者ID:hansel0691,项目名称:VirtualOffice,代码行数:8,代码来源:TokenService.cs


注:本文中的IUnitOfWork.GetRepository方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。