public void SameDbContextinUOWAndRepository() { var uow = _kernel.Get <NeutrinoUnitOfWork>(); Goal goal = new Goal(); goal.ComputingTypeId = ComputingTypeEnum.Amount; goal.GoalGoodsCategoryId = 5098; goal.GoalGoodsCategoryTypeId = GoalGoodsCategoryTypeEnum.Group; goal.GoalTypeId = GoalTypeEnum.Distributor; //2019-01-20 goal.StartDate = new System.DateTime(2018, 12, 22); goal.EndDate = new System.DateTime(2019, 1, 20); IGoalBS goalBusiness = _kernel.Get <IGoalBS>(); //uow.GoalDataService.Insert(goal); //goalBusiness.CreateGoalAsync(goal); GoalServiceController goalServiceController = new GoalServiceController(goalBusiness); //await goalServiceController.Add(new Models.GoalViewModel() //{ // ComputingTypeId = 2, // GoalGoodsCategoryId = 5098, // GoalGoodsCategoryTypeId = 1, // GoalTypeId = 1, // //2019-01-20 // StartDate = "1397/10/01", // EndDate = "1397/10/30" //}); foreach (var item in uow.context.ChangeTracker.Entries()) { } Assert.AreNotEqual(goal.Id, 0); }
public GoalServiceController(IGoalBS businessService) { this.businessService = businessService; }
public PromotionReportServiceController(IPromotionBS promotionBS, IGoalBS goalBS) { this.promotionBS = promotionBS; this.goalBS = goalBS; }