public static RestauranteContexto Instance()
        {
            if (_instanciaContexto == null)
            {
                _instanciaContexto = new RestauranteContexto();
            }

            return(_instanciaContexto);
        }
Beispiel #2
0
        public RetornoServico Atualizar(T dados)
        {
            try
            {
                using (RestauranteContexto contexto = ContextoSingleton.Instance())
                {
                    return(ObtenhaRetornoServico(true));
                }
            }
            catch (Exception)
            {
                return(ObtenhaRetornoServico(false));

                throw;
            }
        }
Beispiel #3
0
        public List <T> Obtenha(string nome)
        {
            try
            {
                using (RestauranteContexto contexto = ContextoSingleton.Instance())
                {
                    return(new List <T>());
                }
            }
            catch (Exception)
            {
                return(new List <T>());

                throw;
            }
        }
Beispiel #4
0
        public RetornoServico Excluir(int codigo)
        {
            try
            {
                using (RestauranteContexto contexto = ContextoSingleton.Instance())
                {
                    return(ObtenhaRetornoServico(true));
                }
            }
            catch (Exception)
            {
                return(ObtenhaRetornoServico(false));

                throw;
            }
        }
Beispiel #5
0
 public Repositorio()
 {
     ioContexto = new RestauranteContexto();
 }
Beispiel #6
0
 public PratoController(RestauranteContexto contexto)
 {
     _context = contexto;
 }