예제 #1
0
 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);
     }
 }
예제 #2
0
 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();
 }
예제 #4
0
 public ZonaEntrenadoresController()
 {
     _dbContext = new MongoDBcontext();
 }
예제 #5
0
 public FotosController()
 {
     _dbContext = new MongoDBcontext();
 }
 public CoachController()
 {
     _dbContext = new MongoDBcontext();
 }
예제 #7
0
 public HomeController()
 {
     _dbContext = new MongoDBcontext();
 }
예제 #8
0
 public PartialsViewsController()
 {
     _dbContext = new MongoDBcontext();
 }