public static object GetVersion(this INakedObjectAdapter nakedObjectAdapter, INakedObjectManager manager) { IAssociationSpec versionProperty = nakedObjectAdapter.GetVersionProperty(); if (versionProperty != null) { object version = versionProperty.GetNakedObject(nakedObjectAdapter).GetDomainObject(); if (version is DateTime) { return(((DateTime)version).StripMillis()); } return(version); } return(null); }
public static object GetVersion(this INakedObjectAdapter nakedObjectAdapter, INakedObjectManager manager) { var versionProperty = nakedObjectAdapter.GetVersionProperty(); if (versionProperty != null) { var version = versionProperty.GetNakedObject(nakedObjectAdapter).GetDomainObject(); if (version is DateTime dtv) { return(dtv.StripMillis()); } return(version); } return(null); }