public Usuario usuarioById(string id) { try { MongoDBcontext _dbContext = new MongoDBcontext(); var collection = _dbContext.GetDatabase().GetCollection <Usuario>("usuarios"); return(collection.AsQueryable().Where(x => x._id == id).Select(x => (Usuario)x).SingleOrDefault()); } catch (Exception) { return(null); } }
public Entrenadores entrenadorById(string id) { try { MongoDBcontext _dbContext = new MongoDBcontext(); var collection = _dbContext.GetDatabase().GetCollection <Entrenadores>("entrenadores"); return(collection.AsQueryable().Where(x => x._id == id).Select(x => (Entrenadores)x).SingleOrDefault()); } catch (Exception) { return(null); } }
public ZonaUsuariosController() { _dbContext = new MongoDBcontext(); }
public ZonaEntrenadoresController() { _dbContext = new MongoDBcontext(); }
public FotosController() { _dbContext = new MongoDBcontext(); }
public CoachController() { _dbContext = new MongoDBcontext(); }
public HomeController() { _dbContext = new MongoDBcontext(); }
public PartialsViewsController() { _dbContext = new MongoDBcontext(); }