Closed DavidRogersDev closed 8 years ago
Yea, you're now fighting in the world of EF. I don't have a good answer for you other than perhaps us ea different DbCtx for your other data.
Thanks Brock. As great as it is, EF can be a hard mistress.
Oh, and as an FYI, I think I just discovered why there is a __MigrationHistory table, even though I am not using Migrations (I much prefer Paul Stovell's DbUp). It is by design and a new thing in EF6.
Hi Brock,
I am trying to use a custom DbContext which effectively combines your MR context with the DbContext of our domain. I feel that is necessary for transactions. I've checked out your samples.
I seemed to be winning this battle right up to the point where the database is created and a second UserAccounts table was being created called UserAccounts1. Note, the 2nd table does not have a Key column as its PK. It uses the ID (Guid) column as its PK (??weird??).
I have a domain class called BqaUser which represents one of our domain users and the idea is that there will be a 1:1 mapping between BqaUsers and UserAccounts. The second UserAccounts table only gets created when I include some kind of FK relationship between them in the mapping file. To clarify that point (b/c it is important), if I do not have any code in the BqaUserMap class setting up the FK relationship between the BqaUser and the UserAccount, then the 2nd, redundant table does not get created.
I'm going to drop some code here in the spirit of helpfulness, but if you are too busy to go through it, that's OK. I'll be happy with just a nudge in the right direction (if possible).
BqaUser:
BqaUserMap:
BqaContext with helper extensions class:
MembershipRebootDbContext:
DefaultUserAccountRepository:
The other curious thing is that it creates a __MigrationHistory table, which I thought was only created if you used Migrations. As far as I can tell, I am not using EF Migrations. I am not using the MigrateDatabaseToLatestVersion class anwhere as an initializer.
Thanks.