how display data into mvc using url(domain url) instead of xml document

Posted by Cpatil1000 under ASP.NET MVC on 9/21/2017 | Points: 10 | Views : 623 | Status : [Member] | Replies : 0
I am new in MVC, Now our company has decide to develop new software in MVC.
So our client will give us api url and we want insert into data into database. I have found some coding how display data, but that coding using xml format data. I want use api url instead of xlm document. my api url is "http:/"

public List<Customer> GetAllCustomers()
List<Customer> customers = new List<Customer>();

XDocument doc = XDocument.Load("D:\\MvcWebAPI\\MvcWebAPI\\Customers.xml");

foreach (XElement element in doc.Descendants("DocumentElement")
Customer customer = new Customer();

customer.CustomerID = element.Element("CustomerID").Value;
customer.CompanyName = element.Element("CompanyName").Value;
customer.City = element.Element("City").Value;


return customers;


(No response found.)

Login to post response