Skip to content

Instantly share code, notes, and snippets.

@thuru-zz
Created July 2, 2018 07:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thuru-zz/2c03f014b814e1a9802bd3bc32824724 to your computer and use it in GitHub Desktop.
Save thuru-zz/2c03f014b814e1a9802bd3bc32824724 to your computer and use it in GitHub Desktop.
DV wrong reference
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
// This is right
services.AddSingleton<IProductService, ProductService>();
// this is wrong and DV should fail
services.AddSingleton<IMyDbContext, MyDbContext>();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment