public UnitOfWork(ApiDataContext dc, IDomainUnitOfWork duow, LoginResDTO loginResDTO, IMapper mapper) { this.duow = duow; this.loginResDTO = loginResDTO; this.mapper = mapper; this.dc = dc; }
public virtual StaffingResourceScreenBase Start(Guid staffingResourceId) { _unitOfWork = null; _staffingResourceId = staffingResourceId; UnitOfWork.StaffingResources.WithIdAsync(staffingResourceId, result => StaffingResource = result, ErrorHandler.HandleError); return this; }
protected override void OnDeactivate(bool close) { base.OnDeactivate(close); if (close) { StaffingResource = null; _unitOfWork = null; } }
public IRepository <TEntity> ForEntity <TEntity>(IDomainUnitOfWork uow) where TEntity : IEntity { var factory = Factories.GetOrAdd(typeof(TEntity), t => ReflectionExtensions.BuildRepositoryFunc <TEntity>()) as Func <IMetrics, IStoreEvents, IStoreSnapshots, IOobWriter, IEventFactory, IDomainUnitOfWork, IRepository <TEntity> >; if (factory == null) { throw new InvalidOperationException("unknown entity repository"); } return(factory(_metrics, _eventstore, _snapstore, _oobStore, _factory, uow)); }
public IPocoRepository <T, TParent> ForPoco <T, TParent>(TParent parent, IDomainUnitOfWork uow) where T : class, new() where TParent : IEntity { var factory = Factories.GetOrAdd(typeof(T), t => ReflectionExtensions.BuildParentPocoRepositoryFunc <T, TParent>()) as Func <TParent, IMetrics, IStoreEvents, IStoreSnapshots, IDomainUnitOfWork, IPocoRepository <T, TParent> >; if (factory == null) { throw new InvalidOperationException("unknown entity repository"); } return(factory(parent, _metrics, _eventstore, _snapstore, uow)); }
public async Task TestMethod1() { IWindsorContainer container = Container.Configure(); UZTask createdTask; using (TaskContext taskContext = new TaskContext()) { createdTask = new UZTask(); createdTask.Id = Guid.NewGuid(); createdTask.Title = "Test title"; taskContext.Tasks.Add(createdTask); await taskContext.SaveChangesAsync(); } using (IDomainUnitOfWork <Guid, UZTask, IRepository <Guid, UZTask> > unitOfWork = container.Resolve <IDomainUnitOfWork <Guid, UZTask, IRepository <Guid, UZTask> > >()) { var task = await unitOfWork.Repository.GetByIdAsync(createdTask.Id); task.Object.Title = "Changed title"; await unitOfWork.CommitAsync(); } using (TaskContext taskContext = new TaskContext()) { taskContext.Database.Log = t => Debug.WriteLine(t); List <string> items = new List <string> { "Changed title" }; IQueryable <UZTask> tasks = taskContext.Tasks.Where(t => items.Contains(t.Title)); /* UZTask task1 = tasks.First(); * task1.Title = "Change title 2";*/ await taskContext.SaveChangesAsync(); } }
public async Task <MessageState[]> Handle(PreviousMessages query, IDomainUnitOfWork uow) { // Can use uow to get domain entities var world = await uow.For <World>().TryGet("World"); if (world == null) { return new MessageState[] { } } ; var states = new List <MessageState>(); foreach (var id in MessageIds) { var message = await world.For <Message>().Get(id).ConfigureAwait(false); states.Add(message.State); } return(states.ToArray()); } }
public CheckEmailExistValidation(IDomainUnitOfWork unitOfWork) { this.unitOfWork = unitOfWork; }
public GetRegisterUserQueryHandler(IDomainUnitOfWork unitOfWork) { this.unitOfWork = unitOfWork; }
public MyRepository(IDomainUnitOfWork unitOfWork) : base(unitOfWork) { }
public UserApplication(ApiDataContext dc, IDomainUnitOfWork uow) { this.uow = uow; this.dc = dc; }
public GetAllUsersPagingQueryHanlder(IDomainUnitOfWork unitOfWork) { this.unitOfWork = unitOfWork; }
public GetBrandByCategoryIdQueryHandler(IDomainUnitOfWork unitOfWork) { this.unitOfWork = unitOfWork; }
public CustomerController(IDomainUnitOfWork unitOfWork) { _unitOfWork = unitOfWork; }
public DeleteMagazineCommandHandler(IDomainUnitOfWork unitOfWork) { this.unitOfWork = unitOfWork; }
public PersonRepository(IDomainUnitOfWork unitOfWork) : base(unitOfWork) { }
public GetBugByIdQueryHandler(IDomainUnitOfWork uow) { _uow = uow; }
public CheckUpdateUserNameExistValidation(IDomainUnitOfWork unitOfWork) { this.unitOfWork = unitOfWork; }
public GetAllPostByCategoryrIdQueryHandler(IDomainUnitOfWork unitOfWork) { this.unitOfWork = unitOfWork; }
public ChangeStateCommandHandler(IDomainUnitOfWork uow) { _uow = uow; }
public DeleteCategoryCommandHandler(IDomainUnitOfWork unitOfWork) { this.unitOfWork = unitOfWork; }
public PocoRepository(TParent parent, IMetrics metrics, IStorePocos store, IMessageSerializer serializer, IDomainUnitOfWork uow) : base(metrics, store, serializer, uow) { _parent = parent; }
public CreatePostMagazineCommandHandler(IDomainUnitOfWork unitOfWork) { this.unitOfWork = unitOfWork; }
public AccountController(IDomainUnitOfWork domainService) { this.domainService = domainService; }
public UpdateCommandHandler(IDomainUnitOfWork unitOfWork) { this.unitOfWork = unitOfWork; }
public SendNotifByBoth(IDomainUnitOfWork unitOfWork) { this.unitOfWork = unitOfWork; }
public DomainRepository(IDomainUnitOfWork <T> context, IDomain domain) : base(context) { }
public CheckCategoryIdIsValidate(IDomainUnitOfWork unitOfWork) { this.unitOfWork = unitOfWork; }
public HomeController(IDomainUnitOfWork domainService) { this.domainService = domainService; }
public SetRegisterUserSettingHandler(IDomainUnitOfWork repository) { this.repository = repository; }
public AddCommentCommandHandler(IDomainUnitOfWork uow, ICurrentUserService userService) { _uow = uow; _userService = userService; }
public CheckRoleRegisterByUserValidation(IDomainUnitOfWork unitOfWork) { this.unitOfWork = unitOfWork; }