I have for example database with codes
entities and I want in single transaction read and update some information.
What will be marked and "locked" or "dirty" when I execute such statement from Entity Framework 6.
using(var context = new codesEntities())
{
using (var trans = db.Database.BeginTransaction(System.Data.IsolationLevel.Snapshot))
{
var codes_in_group = context.codes.Where(x => x.group == 1);
}
}
I am not sure but maybe nothing since nothing is read from querable. Is it anything marked as read?
What will be marked as read if execute such code?
using(var context = new codesEntities())
{
using (var trans = db.Database.BeginTransaction(System.Data.IsolationLevel.Snapshot))
{
var codes_in_group = context.codes.Where(x => x.group == 1).ToList();
}
}
Or such code:
using(var context = new codesEntities())
{
using (var trans = db.Database.BeginTransaction(System.Data.IsolationLevel.Snapshot))
{
var codes_in_group = context.codes.Where(x => x.group == 1).GetEnumerator();
}
}