public static IDataHistory CreateHistoryEntry(this EntityRecord forRecord) { var session = forRecord.Session; var hist = session.NewEntity <IDataHistory>(); hist.TransactionId = session.GetNextTransactionId(); hist.EntityName = forRecord.EntityInfo.FullName; hist.EntityPrimaryKey = forRecord.PrimaryKey.ValuesToString(); hist.EntityData = forRecord.SerializeData(); hist.Action = forRecord.Status.ToHistoryAction(); return(hist); } //method