.Net Core, MVC-6, EF-7
writing data to Postgres SQL:

db.SaveChanges(); db.Database.CommitTransaction(); 

After that I try to read this data using LINQ-SQL - there is no recorded data. Reload page - i.e. new query - the recorded data using LINQ-SQL read!

Actually the question is why the recorded data is not read after the record and what should I do to be read?

All code in one function. No Async or await.

 db.Database.BeginTransaction(); 

I change the base:

 List<License> DelLicenses = db.Licenses .Where(u => u.UserId == UserId && u.ProductId == ProductId).ToList(); db.RemoveRange(DelLicenses); db.SaveChanges(); ....; db.SaveChanges(); db.Database.CommitTransaction(); 

And here it is not read:

 List<License> DelLicenses = db.Licenses .Where(u => u.UserId == UserId && u.ProductId == ProductId).ToList(); 
  • Please give an example of the code that you are doing and in what sequence - Alexcei Shmakov
  • db.Database.BeginTransaction (); - Dmitry Garbuz
  • All code in one function. No Async or await. db.Database.BeginTransaction (); I change the database: List <License> DelLicenses = db.Licenses.Where (u => u.UserId == UserId && u.ProductId == ProductId) .ToList (); db.RemoveRange (DelLicenses); db.SaveChanges (); ....; db.SaveChanges (); db.Database.CommitTransaction (); And here it is not readable: ist <License> DelLicenses = db.Licenses.Where (u => u.UserId == UserId && u.ProductId == ProductId) .ToList (); - Dmitry Garbuz
  • PS: how to format comments even kill me I do not know how. - Dmitry Garbuz
  • I confirm the situation - I also came across this. Removed asp.net-core and .net-core tags, because the bug (?) Is not specific for these platforms. Added tag linq2sql - Pavel Mayorov

0