I am going to explain this in a simple way, and I hope that it will be useful to you.
1) Create an empty console application.
2) Make a service link to any public OData service. That is http://services.odata.org/northwind/northwind.svc/

After that, Visual Studio is going to add some more assembly references, as shown below.

3) Write the following code
using System; using System.Collections.Generic; using System.Data.Services.Client; using System.Linq; using System.Text; using System.Threading.Tasks;
namespace ConsoleApplication4 { class Program { static DataServiceContext ctx = new DataServiceContext(new Uri("http://services.odata.org/northwind/northwind.svc/")); static void Main(string[] args) { IEnumerable<ServiceReference1.Category> response = ctx.Execute<ServiceReference1.Category>(new Uri("http://services.odata.org/northwind/northwind.svc/Categories")); } } }
4) Set a breakpoint at the end of the main method. And now the debugging application. You will see a list of categories.

5) If OData is exposed with permission to implement all CRUDs , you can do it. And, of course, you can return response in ASP.NET MVC, but you must first convert it to your Model class.
Perhaps you can save a static DataServiceContext ctx = new DataServiceContext(new Uri("http://services.odata.org/northwind/northwind.svc/")); in the BaseController class.
And also you get the property value as follows:

PS Check out this video http://www.youtube.com/watch?v=e07TzkQyops .
source share