You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we need a DbContext and define some DbSet ,like this:
public partial class DatabaseContext : DbContext
{
public DbSet<User> Users { get; set; }
public DbSet<Role> Roles { get; set; }
public DatabaseContext(DbContextOptions<DatabaseContext> options) : base(options){}
}
I want to define DbContext dynamic with Attribute on Model class,like this:
[MyDbSet]
[Table("user")]
public class User
{
[Key]
[Column("id")]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public required long id { get; set; }
[Required]
[Column("name")]
public required string name { get; set; }
}
but now, AddEFCoreProviderServices<DatabaseContext> can not do this. if AddEFProviderServices is public, I can pass my dynamic DbContext instance to this method.
i am a beginner in c#, I would be very grateful if you could show me other ways to do this.
file
src/Microsoft.Restier.EntityFramework.Shared/Extensions/RestierEntityFrameworkServiceCollectionExtensions.cs
method
AddEFProviderServices
can public this method?
The text was updated successfully, but these errors were encountered: