Last active
May 15, 2021 19:11
-
-
Save Chriz76/3a4f24cda3af34cb40f09d225d69c0d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddControllers(); | |
services.AddSwaggerGen(c => | |
{ | |
c.SwaggerDoc("v1", new OpenApiInfo { Title = "PostService", Version = "v1" }); | |
}); | |
services.AddDbContext<PostServiceContext>(options => | |
options.UseSqlite(@"Data Source=post.db")); | |
} | |
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, PostServiceContext dbContext) | |
{ | |
if (env.IsDevelopment()) | |
{ | |
dbContext.Database.EnsureCreated | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment