I'm initializing dbContext in my controller as below:
public class BaseController : Controller
{
protected KContext db;
public BaseController()
{
db = new KContext();
}
}
and I do the usual add,edit, delete stuff in my controllers, I also have a class called serviceChecker which inherits registry (from FluentScheduler), and I have another dbcontext initialized there as below:
public class ServiceChecker : Registry
{
KContext db;
public ServiceChecker()
{
db = new KContext();
}
}
and I check some tables in this class and edit some entities which are also get updated from my controllers. Now the problem I'm facing is that after I change an entity, let's call it serviceDoman's field endDate
from 7/11/2014
to 7/11/2016
, it updates the entity fine but when the servicechecker
triggers the check function( every 60 sec), it has to update another field of that entity which happens fine but it also changes the endDate
back to 7/11/2014
(old value before the first edit), what possibly could be the cause?