Northwind mvc 4 with data servieces

Northwind application with web services in mvc 4

See Code First Northwind Data Service Download

Add Service Reference in your app.
now to call web service in action

public ActionResult Index()
{
    var customers = new ServiceReference1.NorthwindContext(
                    new Uri("http://localhost:12345/Northwind.svc/")).Customers;

    List lstCustomer = new List();
    foreach (var item in customers)
    {
        lstCustomer.Add(new Customer
        {
            CustomerID = item.CustomerID,
            CompanyName = item.CompanyName,
            ContactName = item.ContactName,
            ContactTitle = item.ContactTitle,
            Address = item.Address,
            City = item.City,
            Region = item.Region,
            PostalCode = item.PostalCode,
            Country = item.Country,
            Phone = item.Phone,
            Fax = item.Fax
        });
    }

    return View(lstCustomer);
}


Download Example
Northwind mvc 4 with data servieces Northwind mvc 4 with data servieces Reviewed by Bhaumik Patel on 12:27 AM Rating: 5