//private readonly IRepository repository;

        public MessageBus(
            HandlerFinder handlerTypes,
            IFactory factory,
            INewMapper mapper
            //IRepository repository,
            //IClaimsProvider authenticator
            )
        {
            this.handlerTypes = handlerTypes;
            this.factory      = factory;
            this.mapper       = mapper;
            //this.authenticator = authenticator;
        }
Beispiel #2
0
        public void Load(INewMapper mapper)
        {
            mapper.AddCreate <PosteCreate, Poste>((x, y) =>
            {
                y.Nom = x.Nom;
            });

            mapper.AddUpdate <PosteUpdate, Poste>(x => x.Id, (x, y) =>
            {
                y.Nom = x.Nom;
            });

            mapper.AddView <Poste, PosteView>((x, y) =>
            {
                y.Id  = x.Id;
                y.Nom = x.Nom;
            });

            mapper.AddCreate <DepenseCreate, Depense>((x, y) =>
            {
                y.Description = x.Description;
                y.Montant     = x.Montant;
                y.IdPoste     = x.IdPoste;
            });

            /*
             * mapper.AddFrom<DepenseView, Depense, Poste>(
             *  x => x.Id,
             *  (x, y) =>
             *  {
             *      x.Id = y.Id;
             *      x.IdPoste = y.IdPoste;
             *      x.Description = y.Description;
             *      x.Montant = y.Montant;
             *  },
             *  x => x.IdPoste,
             *  (x, z) =>
             *  {
             *      x.NomPoste = z.Nom;
             *  });
             */
        }
 public CreateCommandHandler(IRepository repository, INewMapper mapper)
 {
     this.repository = repository;
     this.mapper     = mapper;
 }
 public ExtendedRepository(INewMapper mapper, IRepository repository)
 {
     this.mapper     = mapper;
     this.repository = repository;
 }
Beispiel #5
0
 public ListQueryHandler(IRepository repository, INewMapper mapper)
 {
     this.repository = repository;
     this.mapper     = mapper;
 }