0
jamsecgmbh created
Dear ASP.NET Boilerplate Support,
I want to use data from the User table in my code - how can I make it accessible? Do I need to create an IDbSet manually in the DbContext class?
Thank you very much and best regards Chris
3 Answer(s)
-
0
Hi,
How do you want to use User table's data ? User entity is alredy included in DbContet.
You can get users by UserManager class.
-
0
Thank you!
How can I create a foreign key pointing to the id of an user in the user table?
[Table("DbAppTesttable")] public class Testtable : FullAuditedEntity<long>, IMustHaveTenant { // Foreign Key: ID of User [ForeignKey("User ... ... }
-
0
It should be something like this,
[ForeignKey("UserId")] public virtual User User { get; set; } public virtual long UserId { get; set; }