Exemplo n.º 1
0
        public static IEnumerable <ClienteModel> ToListModel(IEnumerable <Cliente> listCliente)
        {
            try
            {
                if (listCliente == null)
                {
                    return(null);
                }

                IMapper mapper = MapConfiguration.Config();
                return(mapper.Map <IEnumerable <ClienteModel> >(listCliente));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 2
0
        public static FuncionarioModel ToModel(Funcionario funcionario)
        {
            try
            {
                if (funcionario == null)
                {
                    return(null);
                }

                IMapper mapper = MapConfiguration.Config();
                return(mapper.Map <FuncionarioModel>(funcionario));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 3
0
        public static ClienteModel ToModel(Cliente cliente)
        {
            try
            {
                if (cliente == null)
                {
                    return(null);
                }

                IMapper mapper = MapConfiguration.Config();
                return(mapper.Map <ClienteModel>(cliente));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 4
0
        public static IEnumerable <Filme> ToListDomain(IEnumerable <FilmeModel> filmes)
        {
            try
            {
                if (filmes == null)
                {
                    return(null);
                }

                IMapper mapper = MapConfiguration.Config();
                return(mapper.Map <IEnumerable <Filme> >(filmes));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 5
0
        public static FilmeModel ToModel(Filme filme)
        {
            try
            {
                if (filme == null)
                {
                    return(null);
                }

                IMapper mapper = MapConfiguration.Config();
                return(mapper.Map <FilmeModel>(filme));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 6
0
        public static IEnumerable <AluguelModel> ToListModel(IEnumerable <Aluguel> alugueis)
        {
            try
            {
                if (alugueis == null)
                {
                    return(null);
                }

                IMapper mapper = MapConfiguration.Config();
                return(mapper.Map <IEnumerable <AluguelModel> >(alugueis));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 7
0
        public static AluguelModel ToModel(Aluguel aluguel)
        {
            try
            {
                if (aluguel == null)
                {
                    return(null);
                }

                IMapper mapper = MapConfiguration.Config();
                return(mapper.Map <AluguelModel>(aluguel));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 8
0
 public static void Container(IServiceCollection services)
 {
     try
     {
         services.AddScoped <IVideolocadoraContext, VideolocadoraContext>();
         services.AddTransient <IAluguelRepository, AluguelRepository>();
         services.AddTransient <IClienteRepository, ClienteRepository>();
         services.AddTransient <IFilmeRepository, FilmeRepository>();
         services.AddTransient <IFuncionarioRepository, FuncionarioRepository>();
         services.AddTransient <IAluguelBusiness, AluguelBusiness>();
         services.AddTransient <IClienteBusiness, ClienteBusiness>();
         services.AddTransient <IFilmeBusiness, FilmeBusiness>();
         services.AddTransient <IFuncionarioBusiness, FuncionarioBusiness>();
         services.AddTransient <IControlePromocionalBusiness, ControlePromocionalBusiness>();
         services.AddTransient <IControlePromocionalRepository, ControlePromocionalRepository>();
         services.AddSingleton(MapConfiguration.Config());
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 9
0
 public ClienteModel()
 {
     _mapper = MapConfiguration.Config();
 }
Exemplo n.º 10
0
 public FuncionarioModel()
 {
     _mapper = MapConfiguration.Config();
 }
Exemplo n.º 11
0
 public FilmeModel()
 {
     _mapper = MapConfiguration.Config();
 }
Exemplo n.º 12
0
 public AluguelModel()
 {
     _mapper = MapConfiguration.Config();
 }