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