-
Notifications
You must be signed in to change notification settings - Fork 155
Closed
Labels
📌 seQUESTeredIdentifies that an issue has been imported into Quest.Identifies that an issue has been imported into Quest.Pri1High priority, do before Pri2 and Pri3High priority, do before Pri2 and Pri3databaseContent related to database.Content related to database.doc-enhancementImprove the current content [org][type][category]Improve the current content [org][type][category]help wantedGood for community contributors to help [up-for-grabs]Good for community contributors to help [up-for-grabs]
Description
Type of issue
Missing information
Description
my AppHost program.cs:
var builder = DistributedApplication.CreateBuilder(args);
var sql = builder.AddSqlServerContainer("sql",password:"P4s$wordBuT$tr0ng",port:14420).AddDatabase("sqldata");
builder.AddProject<Projects.adminendpoint>("admin").WithReference(sql);
builder.Build().Run();
Then i want to run it but first make database from my dbcontext that used in admin endpoint.
admin endpoint program.cs is:
builder.AddSqlServerDbContext<DataBaseContext>("sqldata");
builder.Services.AddScoped<IDataBaseContext, DataBaseContext>();
and my dbcontext is :
public class DataBaseContext : DbContext, IDataBaseContext
{
public DataBaseContext(DbContextOptions dbContextOptions):base(dbContextOptions) { }
public DbSet<User> Users { get; set; }
public DbSet<Role> Roles { get; set; }
public DbSet<UserInRole> UserInRoles { get; set; }
}
So how should i use Add-Migration and Update-Database?
Page URL
Content source URL
Document Version Independent Id
2cd52f56-0ee5-8f04-c2b5-fe52c7f8109f
Article author
IEvangelist
paulomorgado
Metadata
Metadata
Assignees
Labels
📌 seQUESTeredIdentifies that an issue has been imported into Quest.Identifies that an issue has been imported into Quest.Pri1High priority, do before Pri2 and Pri3High priority, do before Pri2 and Pri3databaseContent related to database.Content related to database.doc-enhancementImprove the current content [org][type][category]Improve the current content [org][type][category]help wantedGood for community contributors to help [up-for-grabs]Good for community contributors to help [up-for-grabs]