internal bool SerializeRevisionId <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s, string attributeName, ref int revisionId, bool isOptional = false) where TDoc : class where TCursor : class { bool streamed = true; if (isOptional) { streamed = s.StreamAttributeOptIdAsInt32(attributeName, ref revisionId, this, RevisionIdResolver, RevisionNameResolver, Predicates.IsNotNone); if (!streamed && s.IsReading) { revisionId = TypeExtensions.kNone; } } else { s.StreamAttributeIdAsInt32(attributeName, ref revisionId, this, RevisionIdResolver, RevisionNameResolver); } return(streamed); }