Ejemplo n.º 1
0
        /// <summary>
        /// Dependency Injection to database repositories.
        /// </summary>
        /// <param name="unitOfWork"> Point to context of dataBase </param>
        public UserService(IIdentityUnitOfWork unitOfWork)
        {
            Database = unitOfWork;

            // Using Factory Method.
            MapperCreator  creator       = new IdentityCreator();
            IWrappedMapper wrappedMapper = creator.FactoryMethod();

            mapper = wrappedMapper.CreateMapping();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Dependency Injection to database repositories.
        /// </summary>
        /// <param name="uow"> Point to context of dataBase </param>
        public TeamService(IUnitOfWork uow)
        {
            db = uow;

            // Using Factory Method.
            MapperCreator  creator       = new CommonCreator();
            IWrappedMapper wrappedMapper = creator.FactoryMethod();

            mapper = wrappedMapper.CreateMapping();
        }
Ejemplo n.º 3
0
        public TaskService(IUnitOfWork uow, IEmailService emailService)
        {
            db = uow;
            this.emailService = emailService;

            // Using Factory Method.
            MapperCreator  creator       = new CommonCreator();
            IWrappedMapper wrappedMapper = creator.FactoryMethod();

            mapper = wrappedMapper.CreateMapping();
        }
Ejemplo n.º 4
0
        public TokenService(IIdentityUnitOfWork unitOfWork, IConfiguration configuration)
        {
            Database      = unitOfWork;
            Configuration = configuration;

            // Using Factory Method.
            MapperCreator  creator       = new IdentityCreator();
            IWrappedMapper wrappedMapper = creator.FactoryMethod();

            mapper = wrappedMapper.CreateMapping();
        }
Ejemplo n.º 5
0
        public IMapper GetMapper()
        {
            _wrappedMapper = FactoryMethod();

            return(_wrappedMapper.CreateMapping());
        }