Exemplo n.º 1
0
 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;
            }
        }
Exemplo n.º 4
0
        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));
        }
Exemplo n.º 5
0
        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));
        }
Exemplo n.º 6
0
        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();
            }
        }
Exemplo n.º 7
0
        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());
        }
    }
Exemplo n.º 8
0
 public CheckEmailExistValidation(IDomainUnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }
Exemplo n.º 9
0
 public GetRegisterUserQueryHandler(IDomainUnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }
Exemplo n.º 10
0
 public MyRepository(IDomainUnitOfWork unitOfWork) : base(unitOfWork)
 {
 }
Exemplo n.º 11
0
 public UserApplication(ApiDataContext dc, IDomainUnitOfWork uow)
 {
     this.uow = uow;
     this.dc  = dc;
 }
 public GetAllUsersPagingQueryHanlder(IDomainUnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }
Exemplo n.º 13
0
 public GetBrandByCategoryIdQueryHandler(IDomainUnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }
 public CustomerController(IDomainUnitOfWork unitOfWork)
 {
     _unitOfWork = unitOfWork;
 }
Exemplo n.º 15
0
 public DeleteMagazineCommandHandler(IDomainUnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }
Exemplo n.º 16
0
 public PersonRepository(IDomainUnitOfWork unitOfWork) : base(unitOfWork)
 {
 }
Exemplo n.º 17
0
 public GetBugByIdQueryHandler(IDomainUnitOfWork uow)
 {
     _uow = uow;
 }
Exemplo n.º 18
0
 public CheckUpdateUserNameExistValidation(IDomainUnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }
 public GetAllPostByCategoryrIdQueryHandler(IDomainUnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }
Exemplo n.º 20
0
 public ChangeStateCommandHandler(IDomainUnitOfWork uow)
 {
     _uow = uow;
 }
 public DeleteCategoryCommandHandler(IDomainUnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }
Exemplo n.º 22
0
 public PocoRepository(TParent parent, IMetrics metrics, IStorePocos store, IMessageSerializer serializer, IDomainUnitOfWork uow)
     : base(metrics, store, serializer, uow)
 {
     _parent = parent;
 }
Exemplo n.º 23
0
 public CreatePostMagazineCommandHandler(IDomainUnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }
 public AccountController(IDomainUnitOfWork domainService)
 {
     this.domainService = domainService;
 }
Exemplo n.º 25
0
 public UpdateCommandHandler(IDomainUnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }
Exemplo n.º 26
0
 public SendNotifByBoth(IDomainUnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }
Exemplo n.º 27
0
 public DomainRepository(IDomainUnitOfWork <T> context, IDomain domain) : base(context)
 {
 }
Exemplo n.º 28
0
 public CheckCategoryIdIsValidate(IDomainUnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }
Exemplo n.º 29
0
 public HomeController(IDomainUnitOfWork domainService)
 {
     this.domainService = domainService;
 }
Exemplo n.º 30
0
 public SetRegisterUserSettingHandler(IDomainUnitOfWork repository)
 {
     this.repository = repository;
 }
Exemplo n.º 31
0
 public AddCommentCommandHandler(IDomainUnitOfWork uow, ICurrentUserService userService)
 {
     _uow         = uow;
     _userService = userService;
 }
 public CheckRoleRegisterByUserValidation(IDomainUnitOfWork unitOfWork)
 {
     this.unitOfWork = unitOfWork;
 }