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


C# IUnitOfWorkAsync.RepositoryAsync方法代码示例

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


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

示例1: WeekMenuController

 public WeekMenuController(IUnitOfWorkAsync unitOfWork)
 {
     _unitOfWork = unitOfWork;
     _db = _unitOfWork.GetContext();
     _weekmenuService = new MenuForWeekService(_unitOfWork.RepositoryAsync<MenuForWeek>());
     _mfdDishPriceService=new MfdDishPriceService(_unitOfWork.RepositoryAsync<MfdDishPriceRelations>());
 }
开发者ID:densem-2013,项目名称:ACSDining,代码行数:7,代码来源:WeekMenuController.cs

示例2: EmployeeOrderApiController

 public EmployeeOrderApiController(IUnitOfWorkAsync unitOfWorkAsync)
 {
     _unitOfWork = unitOfWorkAsync;
     _db = unitOfWorkAsync.GetContext();
     _weekMenuService = new MenuForWeekService(_unitOfWork.RepositoryAsync<MenuForWeek>());
     _orderMenuService = new OrderMenuService(_unitOfWork.RepositoryAsync<WeekOrderMenu>());
     _weekPaimentService = new WeekPaimentService(_unitOfWork.RepositoryAsync<WeekPaiment>());
 }
开发者ID:densem-2013,项目名称:ACSDining,代码行数:8,代码来源:EmployeeOrderApiController.cs

示例3: TestWeekMenuController

 public TestWeekMenuController()
 {
     _unitOfWork = new UnitOfWork(new ApplicationDbContext());
     _db = _unitOfWork.GetContext();
     _weekMenuService = new MenuForWeekService(_unitOfWork.RepositoryAsync<MenuForWeek>());
     _userManager = new ApplicationUserManager(new UserStore<User>(_unitOfWork.GetContext()));
 }
开发者ID:densem-2013,项目名称:ACSDining,代码行数:7,代码来源:TestWeekMenuController.cs

示例4: MigrationTest

 public MigrationTest()
 {
     _unitOfWork = new UnitOfWork(new ApplicationDbContext());
     dataContext = _unitOfWork.GetContext();
     IRepositoryAsync<MenuForWeek> menuRepo = _unitOfWork.RepositoryAsync<MenuForWeek>();
     _menuForWeekService = new MenuForWeekService(menuRepo);
     _userManager = new ApplicationUserManager(new UserStore<User>(dataContext));
 }
开发者ID:densem-2013,项目名称:ACSDining,代码行数:8,代码来源:MigrationTest.cs

示例5: GetMapDto

        public static WeekOrderDto GetMapDto(IUnitOfWorkAsync unitOfWork, WeekYearDto wyDto, bool needfact = true)
        {
            ApplicationDbContext context = unitOfWork.GetContext();

            MenuForWeek menuForWeek = unitOfWork.RepositoryAsync<MenuForWeek>().GetWeekMenuByWeekYear(wyDto);

            if (menuForWeek == null) return null;

            List<WeekOrderMenu> weekOrderMenus = unitOfWork.RepositoryAsync<WeekOrderMenu>()
                .OrdersMenuByWeekYear(wyDto).Where(word=>word.User.IsExisting).OrderBy(wo=>wo.User.LastName).ToList();

            return new WeekOrderDto
            {
                WeekYearDto = wyDto,
                SuCanChangeOrder = menuForWeek.SUCanChangeOrder,
                UserWeekOrders =
                    weekOrderMenus.Select(woDto => UserWeekOrderDto.MapDto(context, woDto)).ToList(),
                DayNames = context.GetDayNames(wyDto, true).Result,
                WeekDishPrices = context.GetWeekDishPrices(wyDto).Result,
                SummaryDishQuantities = context.GetFactSumWeekUserCounts(wyDto).Result,
                AllDayNames = context.GetDayNames(wyDto).Result
            };
        }
开发者ID:densem-2013,项目名称:ACSDining,代码行数:23,代码来源:WeekOrderDto.cs

示例6: AccountController

 public AccountController(IUnitOfWorkAsync unitOfWork)
 {
     //This is temproray solution, for issue on DB create if it does not exists.
     var a = unitOfWork.RepositoryAsync<AspNetUser>().Query().Select(x => x).FirstOrDefault();
     UserManager = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(new ApplicationDbContext()));
 }
开发者ID:arkirakosyan,项目名称:MyStories,代码行数:6,代码来源:AccountController.cs

示例7: DiagnosesService

 public DiagnosesService(IUnitOfWorkAsync unitOfWork)
 {
     _unitOfWork = unitOfWork;
     _dignosisRepo = unitOfWork.RepositoryAsync<Diagnosis>();
     _dignosisSymptomRepo = unitOfWork.RepositoryAsync<DiagnosisSymptom>();
 }
开发者ID:mkhabibullin,项目名称:MedDiagnostic,代码行数:6,代码来源:DiagnosesService.cs

示例8: PaimentController

 public PaimentController(IUnitOfWorkAsync unitOfWorkAsync)
 {
     _unitOfWork = unitOfWorkAsync;
     //_db = unitOfWorkAsync.GetContext();
     _weekPaimentService = new WeekPaimentService(_unitOfWork.RepositoryAsync<WeekPaiment>());
 }
开发者ID:densem-2013,项目名称:ACSDining,代码行数:6,代码来源:PaimentController.cs

示例9: DishesController

 public DishesController(IUnitOfWorkAsync unitOfWork)
 {
     _unitOfWork = unitOfWork;
     _mfdDishPriceService = new MfdDishPriceService(_unitOfWork.RepositoryAsync<MfdDishPriceRelations>());
 }
开发者ID:densem-2013,项目名称:ACSDining,代码行数:5,代码来源:DishesController.cs

示例10: GetExcelController

 public GetExcelController(IUnitOfWorkAsync unitOfWork)
 {
     _unitOfWork = unitOfWork;
     _getExcelService = new GetExcelService(_unitOfWork.RepositoryAsync<WeekOrderMenu>());
     _menuForWeekService = new MenuForWeekService(_unitOfWork.RepositoryAsync<MenuForWeek>());
 }
开发者ID:densem-2013,项目名称:ACSDining,代码行数:6,代码来源:GetExcelController.cs


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