public async Task <Medicine> AddMedicine(Medicine medicine)
        {
            medicine.Id = Guid.NewGuid().ToString("N");
            await _medicineDb.InsertOneAsync(medicine);

            return(_medicineDb.AsQueryable().FirstOrDefault(m => m.Id == medicine.Id));
        }
Esempio n. 2
0
 public async Task InsertOneAsync()
 {
     await _collection.InsertOneAsync(new User { Name = "Teddy" });
 }