I am trying to update the entity that has some columns with foreign keys. Everything seems to work fine but during first time assignment, it takes more than 1 minute but if I execute the same action again , it comes immediately.
Code Snippet :
public bool UpdateStatus(DetailDataModel DetailDataModel)
{
Details updateStatus = (from d in UnitOfWork.Details
where d.Id == DetailDataModel.Id
select d).FirstOrDefault();
updateStatus.StatusId = DetailDataModel.StatusId;
UnitOfWork.Commit();
return true;
}
Below is the culprit line :
updateStatus.StatusId = updateStatus.StatusId;
I cannot find the problem but when try to update other columns of the same entity, it works fine and the problem is only with Foreignkey columns. Is there any limitation for association with Entity framework.
Please suggest your thoughts on it, Thanks in Advance.