We use the Fluent nHibernate repository model in a .net MVC project that I'm working on. While running a sql profile to check for areas of improvement we noticed that some objects were getting UPDATEd without an explicit Save. Does anybody know why nHibernate would choose to update an object when I select it?
Class:
public class Request : DomainEntity
{
public virtual string Code { get; set; }
public virtual string PartCode { get; set; }
public virtual string Description { get; set; }
public virtual int Quantity { get; set; }
public virtual decimal Price { get; set; }
public virtual DateTime DateRecieved { get; set; }
}
Sample usage:
var request = _repository.Query<Request>().Where(x => x.OemCode == "TEST").FirstOrDefault();
After running this code with different Request codes our trace often finds what appears to be random Updates. Any ideas?