Exemplo n.º 1
0
        public static object GetVersion(this INakedObject nakedObject, INakedObjectManager manager)
        {
            IAssociationSpec versionProperty = nakedObject.GetVersionProperty();

            if (versionProperty != null)
            {
                object version = versionProperty.GetNakedObject(nakedObject).GetDomainObject();

                if (version is DateTime)
                {
                    return(((DateTime)version).StripMillis());
                }
                if (version != null)
                {
                    return(version);
                }
            }

            return(null);
        }