public ActionResult AddElement([FromBody] IInfected m)
        {
            var infected = new Infected(m.Birth, m.Gender, m.Latitude, m.Longitude);

            _infectedCollection.InsertOne(infected);

            return(StatusCode(201, "Adicionado com sucesso"));
        }
Exemplo n.º 2
0
 public InfectedController(IInfected repository, DbConnection connection)
 {
     _mongoDB            = connection;
     _infectedCollection = _mongoDB.database.GetCollection <Infected>("Infected");
     _repository         = repository;
 }