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); }
public UnitOfWork(VecinosUYContext VecinosUYContext) { context = VecinosUYContext; }
public GenericRepository(VecinosUYContext context) { this.context = context; this.dbSet = context.Set <TEntity>(); }