hi can anyone help how to write moq for entity for the method given below.
especially for properties like "db.Entry(driver).Property(x => x.EffectiveDate).IsModified = true;"
public bool UpdateEffectiveDate(int driverId, DateTime effectiveDate, string UserId)
{
db myentity=new myentity();
Driver driver = db.Drivers.Find(driverId);
driver.EffectiveDate = effectiveDate;
driver.LastModifiedBy = UserId;
driver.LastModifiedDate = DateTime.Now;
db.Drivers.Attach(driver);
db.Entry(driver).Property(x => x.EffectiveDate).IsModified = true;
db.Entry(driver).Property(x => x.LastModifiedBy).IsModified = true;
db.Entry(driver).Property(x => x.LastModifiedDate).IsModified = true;
return (db.SaveChanges() > 0);
}
thanks in advance