title: Use Entity Framework to access data from a Web service?
body: <p>So I've used Entity Framework as a data abstraction layer on SQL databases, avoiding the need to write SQL queries, but using (something like?) LINQ instead. And then EF translates all that to SQL and connects to databases automatically. It's a very easy way to manage data given a model.</p>
  
  <p>Now I am making a REST client, and I am thinking of using EF for accessing that as well.</p>
  
  <p>So how do I make this thing connect to a REST API, instead of an SQL database? Googling Entity Framework together with REST only told me how to make a REST <strong>server</strong> use EF for accessing a <strong>database</strong>. I want to use EF on a the <strong>client</strong> side that accesses a <strong>Web server</strong>, that in turn accesses the data.</p>
  
  <p>So I expect something like writing model.Users.Where(...) and it being translated to a GET /api/users?filter... HTTP request (instead of classic SELECT * FROM Users WHERE... SQL query).</p>
  
  <p>I tried creating an "ADO.NET Entity Data Model" like I do usually but all options it provides require me to specify a connection string - this only applies to databases. I want an API endpoint, not an SQL connection string.</p>
  
  <p>AFAIK EF connects to a "DataSet" object (created automatically and connected to a database), but then again I don't know how to make those use REST API. Do I need to write my own class that implements DataSet, and somehow make EF use THAT? Everything I've seen about DataSets also seem to literally imply SQL databases. Grrr.</p>
  
  <p>Sorry for long post with such a simple question. So does someone know <strong>how to make Entity Framework use a REST service instead of a database</strong>? It should be so simple. After all, Microsoft calls it a <strong>data access</strong> abstraction layer. Not <strong>database access</strong>.</p>