Created
February 1, 2020 14:33
-
-
Save itsmaheshkariya/a0509c03005ae690eca112540a903868 to your computer and use it in GitHub Desktop.
Dotnet notes
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
dotnet tool install --global dotnet-ef --version 3.0.0 | |
dotnet ef | |
dotnet new web |
Author
itsmaheshkariya
commented
Feb 1, 2020
services.AddDbContext<AspDbContext>(options =>
options.UseSqlServer(config.GetConnectionString("optimumDB")));
pdate do not forget to add using Microsoft.EntityFrameworkCore; namespace```
{
"Data":{
"CommandAPIConnaction":{
"ConnectionString":"Server=127.0.0.1;Database=test;User=sa;Password=mahesh619619@Key;Trusted_Connection=False"
}
}
}
Startup class
using Swashbuckle.AspNetCore.Swagger;
Inside ConfigureServices
services.AddSwaggerGen(c => {
c.SwaggerDoc("v1", new Info {Title="My Core API", Description="Swagger" });
});
Inside Configure
app.UseSwagger();
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/swagger/v1/swagger.json","Core API");
});
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment