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."));
        }
Beispiel #2
0
 public void Remove(GoodPractices gpIn) =>
 _gps.DeleteOne(gp => gp.Id == gpIn.Id);
Beispiel #3
0
 public void Update(string id, GoodPractices gpIn) =>
 _gps.ReplaceOne(gp => gp.Id == id, gpIn);
Beispiel #4
0
 public GoodPractices Create(GoodPractices gp)
 {
     _gps.InsertOne(gp);
     return(gp);
 }