File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -21,9 +21,14 @@ public Startup(IConfiguration configuration)
21
21
// This method gets called by the runtime. Use this method to add services to the container.
22
22
public void ConfigureServices ( IServiceCollection services )
23
23
{
24
- // add database dependecy
24
+ //// use in-memory database
25
+ //services.AddDbContext<AspnetRunContext>(c =>
26
+ // c.UseInMemoryDatabase("AspnetRunConnection"));
27
+
28
+ // add real database dependecy
25
29
services . AddDbContext < AspnetRunContext > ( c =>
26
- c . UseSqlServer ( Configuration . GetConnectionString ( "AspnetRunConnection" ) ) ) ;
30
+ c . UseSqlServer ( Configuration . GetConnectionString ( "AspnetRunConnection" ) ) ) ;
31
+
27
32
// add repository dependecy
28
33
services . AddScoped < IProductRepository , ProductRepository > ( ) ;
29
34
You can’t perform that action at this time.
0 commit comments