private async Task <IActionResult> SaveToMongo(string url)
        {
            await Task.Run(() => {
                using (WebClient wc = new WebClient())
                {
                    var json = wc.DownloadString(url);
                    var data = JsonConvert.DeserializeObject <GoodPracticesDocument>(json);
                    var gp   = new GoodPractices(data);

                    _gpService.Create(gp);

                    return(Ok());
                }
            });

            return(Content("No se ha podido leer el resultado."));
        }
Пример #2
0
 public void Remove(GoodPractices gpIn) =>
 _gps.DeleteOne(gp => gp.Id == gpIn.Id);
Пример #3
0
 public void Update(string id, GoodPractices gpIn) =>
 _gps.ReplaceOne(gp => gp.Id == id, gpIn);
Пример #4
0
 public GoodPractices Create(GoodPractices gp)
 {
     _gps.InsertOne(gp);
     return(gp);
 }