This is my connection string :
"ConnectionStrings": { "EvSefDBConnection": "Server=.;Database=evsef_db;Trusted_Connection=True;MultipleActiveResultSets=true\"\""
and with this context:
public class EvSefDbContext : DbContext {
public EvSefDbContext(DbContextOptions<EvSefDbContext> options) : base(options)
{ } }
and in program.cs I have this config:
builder.Services.AddDbContext<EvSefDbContext>(options =>{ options.UseSqlServer(builder.Configuration.GetConnectionString("EvSefDBConnection"));});
But after I add-migration Initial database it was created but both up and down is empty . I want just create my data base with out any table and model, I want just create data base in sql server.
this is empty migration:
public partial class initial2db : Migration {
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
You need to add the entities into the context, otherwise they will not be generated.