Skip to content
Advertisement

Tag: entity-framework-core

EF Core transaction lifetime

We are using our select statement inside transaction scope because of concurrency concerns. The question is, if I put my transaction in using statement, do I still have to call Commit() method explicitly to be sure that the transaction is closed or Dispose() method will do the job? Here’s example code: Answer The official docs would be your best friend

Unable to make raw SQL calls from Entity Framework Core

I am working on a project where I am moving specific rows from a table between multiple different environments. The table has an Identity column and when I try to move it I get an error that Identity_Insert is off. Looking at several of the questions on here one of the solutions has been to call Context.Database.ExecuteSqlCommand(), ExecuteSqlRaw() or the

In entity framework core, how we can set relationship for a table, when two fields is mapping to primary key of the another table

In entity framework core, how we can set relationship for a table, when two fields is mapping to primary key of the another table. For example I have two table namely Users & CashBox. Users Table Field Value UserId int UserName string CashBox Table Field Value CashBoxId int ActivatedBy int DeactivatedBy int In this case, activatedby & deactivatedby has to

Advertisement