本文整理汇总了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>());
}
示例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>());
}
示例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()));
}
示例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));
}
示例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
};
}
示例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()));
}
示例7: DiagnosesService
public DiagnosesService(IUnitOfWorkAsync unitOfWork)
{
_unitOfWork = unitOfWork;
_dignosisRepo = unitOfWork.RepositoryAsync<Diagnosis>();
_dignosisSymptomRepo = unitOfWork.RepositoryAsync<DiagnosisSymptom>();
}
示例8: PaimentController
public PaimentController(IUnitOfWorkAsync unitOfWorkAsync)
{
_unitOfWork = unitOfWorkAsync;
//_db = unitOfWorkAsync.GetContext();
_weekPaimentService = new WeekPaimentService(_unitOfWork.RepositoryAsync<WeekPaiment>());
}
示例9: DishesController
public DishesController(IUnitOfWorkAsync unitOfWork)
{
_unitOfWork = unitOfWork;
_mfdDishPriceService = new MfdDishPriceService(_unitOfWork.RepositoryAsync<MfdDishPriceRelations>());
}
示例10: GetExcelController
public GetExcelController(IUnitOfWorkAsync unitOfWork)
{
_unitOfWork = unitOfWork;
_getExcelService = new GetExcelService(_unitOfWork.RepositoryAsync<WeekOrderMenu>());
_menuForWeekService = new MenuForWeekService(_unitOfWork.RepositoryAsync<MenuForWeek>());
}