示例#1
0
        public IEnumerable <LaboratoryViewModel> ToListViewModel(IEnumerable <Laboratory> Laboratorys)
        {
            var config = new MapConfig().ToViewModel();
            var mapper = config.CreateMapper();

            return(mapper.Map <IEnumerable <Laboratory>, IEnumerable <LaboratoryViewModel> >(Laboratorys));
        }
示例#2
0
        public IEnumerable <UserViewModel> ToListViewModel(IEnumerable <User> Users)
        {
            var config = new MapConfig().ToViewModel();
            var mapper = config.CreateMapper();

            return(mapper.Map <IEnumerable <User>, IEnumerable <UserViewModel> >(Users));
        }
示例#3
0
        public IEnumerable <ProductViewModel> ToListViewModel(IEnumerable <Product> Products)
        {
            var config = new MapConfig().ToViewModel();
            var mapper = config.CreateMapper();

            return(mapper.Map <IEnumerable <Product>, IEnumerable <ProductViewModel> >(Products));
        }
        public QualityResultViewModel ToViewModel(QualityResult QualityResult)
        {
            var config = new MapConfig().ToViewModel();
            var mapper = config.CreateMapper();

            return(mapper.Map <QualityResultViewModel>(QualityResult));
        }
示例#5
0
        public ProductViewModel ToViewModel(Product Product)
        {
            var config = new MapConfig().ToViewModel();
            var mapper = config.CreateMapper();

            return(mapper.Map <ProductViewModel>(Product));
        }
        public IEnumerable <QualityResultViewModel> ToListViewModel(IEnumerable <QualityResult> QualityResults)
        {
            var config = new MapConfig().ToViewModel();
            var mapper = config.CreateMapper();

            return(mapper.Map <IEnumerable <QualityResult>, IEnumerable <QualityResultViewModel> >(QualityResults));
        }
示例#7
0
        public UserViewModel ToViewModel(User User)
        {
            var config = new MapConfig().ToViewModel();
            var mapper = config.CreateMapper();

            return(mapper.Map <UserViewModel>(User));
        }
示例#8
0
        public LotViewModel ToViewModel(Lot lot)
        {
            var config = new MapConfig().ToViewModel();
            var mapper = config.CreateMapper();

            return(mapper.Map <LotViewModel>(lot));
        }
示例#9
0
        public IEnumerable <AnalysisViewModel> ToListViewModel(IEnumerable <Analysis> Analysiss)
        {
            var config = new MapConfig().ToViewModel();
            var mapper = config.CreateMapper();

            return(mapper.Map <IEnumerable <Analysis>, IEnumerable <AnalysisViewModel> >(Analysiss));
        }
示例#10
0
        public LaboratoryViewModel ToViewModel(Laboratory Laboratory)
        {
            var config = new MapConfig().ToViewModel();
            var mapper = config.CreateMapper();

            return(mapper.Map <LaboratoryViewModel>(Laboratory));
        }
示例#11
0
        public AnalysisViewModel ToViewModel(Analysis Analysis)
        {
            var config = new MapConfig().ToViewModel();
            var mapper = config.CreateMapper();

            return(mapper.Map <AnalysisViewModel>(Analysis));
        }
示例#12
0
        protected virtual S SnapshotMap(T s)
        {
            //return AutoMapper.Mapper.Map<T, S>(s);
            var mapper = MapConfig.CreateMapper();

            return(mapper.Map <T, S>(s));
        }
示例#13
0
        }                                   //utilizado apenas na view
        #endregion

        public Product ToDomain()
        {
            var     config  = new MapConfig().ToDomain();
            var     mapper  = config.CreateMapper();
            Product Product = mapper.Map <Product>(this);

            return(Product);
        }
示例#14
0
        public Laboratory ToDomain()
        {
            var        config     = new MapConfig().ToDomain();
            var        mapper     = config.CreateMapper();
            Laboratory Laboratory = mapper.Map <Laboratory>(this);

            return(Laboratory);
        }
示例#15
0
        public Analysis ToDomain()
        {
            var      config   = new MapConfig().ToDomain();
            var      mapper   = config.CreateMapper();
            Analysis Analysis = mapper.Map <Analysis>(this);

            return(Analysis);
        }
示例#16
0
        public User ToDomain()
        {
            var  config = new MapConfig().ToDomain();
            var  mapper = config.CreateMapper();
            User User   = mapper.Map <User>(this);

            return(User);
        }
        public QualityResult ToDomain()
        {
            var           config        = new MapConfig().ToDomain();
            var           mapper        = config.CreateMapper();
            QualityResult QualityResult = mapper.Map <QualityResult>(this);

            return(QualityResult);
        }
示例#18
0
        public Lot ToDomain()
        {
            var config = new MapConfig().ToDomain();
            var mapper = config.CreateMapper();
            Lot Lot    = mapper.Map <Lot>(this);

            return(Lot);
        }
示例#19
0
        private void ConfigureContainer()
        {
            _kernel.Bind(x => x
                         .FromAssemblyContaining <ProjectService>()
                         .SelectAllClasses()
                         .InheritedFrom(typeof(IDomainService))
                         .BindDefaultInterface());

            _kernel.Bind(x => x
                         .FromThisAssembly()
                         .IncludingNonePublicTypes()
                         .SelectAllClasses()
                         .InheritedFrom(typeof(IConsumer))
                         .BindToSelf());

            var busControl = Bus.Factory.CreateUsingRabbitMq(x =>
            {
                var host = x.Host(GetHostAddress(), h =>
                {
                    h.Username(ConfigurationManager.AppSettings["RabbitMQUsername"]);
                    h.Password(ConfigurationManager.AppSettings["RabbitMQPassword"]);
                });

                x.ReceiveEndpoint(host, "commands", e =>
                {
                    e.LoadFrom(_kernel);
                });
            });

            _kernel.Bind <IBusControl>()
            .ToConstant(busControl)
            .InSingletonScope();

            _kernel.Bind <IBus>()
            .ToProvider(new CallbackProvider <IBus>(x => x.Kernel.Get <IBusControl>()));

            var bus = _kernel.Get <IBusControl>();

            _kernel.Bind <IStoreEvents>()
            .ToMethod(context => EventStoreConfig.Create(bus))
            .InSingletonScope();

            _kernel.Bind <IMapper>().ToConstant(MapConfig.CreateMapper()).InSingletonScope();

            _kernel.Bind <IDetectConflicts>().To <ConflictDetector>();
            _kernel.Bind <IRepository>().To <EventStoreRepository>();
            _kernel.Bind <IConstructAggregates>().To <AggregateFactory>();
        }