Skip to content

Instantly share code, notes, and snippets.

@xuzhg
Created July 3, 2018 22:58
Show Gist options
  • Select an option

  • Save xuzhg/5a6cfc1971f9ce448e1f0135a57339fc to your computer and use it in GitHub Desktop.

Select an option

Save xuzhg/5a6cfc1971f9ce448e1f0135a57339fc to your computer and use it in GitHub Desktop.
ConfigureServicesDb.cs
public class Startup
{
// ...
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<BookStoreContext>(opt => opt.UseInMemoryDatabase("BookLists"));
services.AddOData();
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment