示例#1
0
        public Publication GetPublication(Publication publication)
        {
            if (publication == null)
            {
                return(null);
            }

            if (publication.DOI != null &&
                PubsByDOI.ContainsKey(publication.DOI))
            {
                return(PubsByDOI[publication.DOI]);
            }

            if (publication.PubMedID != null &&
                PubsByPMID.ContainsKey(publication.PubMedID))
            {
                return(PubsByPMID[publication.PubMedID]);
            }

            if (publication.Title != null &&
                PubsByTitle.ContainsKey(publication.Title))
            {
                return(PubsByTitle[publication.Title]);
            }

            return(null);
        }
示例#2
0
        public bool PublicationExists(Publication publication)
        {
            if (publication == null)
            {
                return(false);
            }

            if (publication.DOI != null &&
                PubsByDOI.ContainsKey(publication.DOI))
            {
                return(true);
            }

            if (publication.PubMedID != null &&
                PubsByPMID.ContainsKey(publication.PubMedID))
            {
                return(true);
            }

            if (publication.Title != null &&
                PubsByTitle.ContainsKey(publication.Title))
            {
                return(true);
            }

            return(false);
        }