Beispiel #1
0
        private static User getUserLoged(HttpRequestMessage request)
        {
            VecinosUYContext     db = new VecinosUYContext();
            IEnumerable <string> token;

            request.Headers.TryGetValues("TODO_PAGOS_TOKEN", out token);
            if (token == null)
            {
                throw new NotExistException("no logueado");
            }
            User usr = db.Users.Find(token.FirstOrDefault());

            if (usr == null)
            {
                throw new NotExistException("tocken incorrecto");
            }
            return(usr);
        }
Beispiel #2
0
 public UnitOfWork(VecinosUYContext VecinosUYContext)
 {
     context = VecinosUYContext;
 }
Beispiel #3
0
 public GenericRepository(VecinosUYContext context)
 {
     this.context = context;
     this.dbSet   = context.Set <TEntity>();
 }