public void LoadList() { var repo = new DAL.GenericRepository(); WebApi.ItemsSource = repo.LoadList().mostrandoTraducciones; /* * HttpWebRequest request = WebRequest.Create(RestService.Servidor + RestService.Methods.TraductorMethod ) as HttpWebRequest; * request.Method = RestService.HTTPMethods.Get; * request.ContentType = RestService.ContentType; * string resp; * HttpWebResponse response = request.GetResponse() as HttpWebResponse; * //----------- * using (StreamReader reader = new StreamReader(response.GetResponseStream())) * { * resp = reader.ReadToEnd(); * Model obj = JsonConvert.DeserializeObject<Model>(resp); * WebApi.ItemsSource = obj.mostrandoTraducciones; * * } * */ }
private void TestClient(Entities.SalesDbContext dbContext) { Console.WriteLine("\tStart test client repository"); var repClient = new DAL.GenericRepository <Entities.Client>(dbContext); var client = new Entities.Client { Name = $"TestReposClient {dbContext.Clients.Count()}" }; TestInsert(repClient, client); TestGet(repClient); client.Name = $"Updated name client with id={client.Id}"; TestUpdate(repClient, client); TestGet(repClient); TestDelete(repClient, client); TestGet(repClient); //TestDeleteById(repClient); TestGet(repClient); TestGetById(repClient); Console.WriteLine("\t Finish test client repository"); }