Exemplo n.º 1
0
 public static XElement HeaderItem(Header rec, string granularity)
 {
     return rec == null ? null
         : new XElement("header",
             new XElement("identifier", rec.OAI_Identifier),
             new XElement("datestamp", rec.Datestamp.HasValue ? rec.Datestamp.Value.ToString(granularity) : rec.Datestamp.ToString()),
             from s in rec.OAI_Set.Split(';')
             select new XElement("setSpec", s));
 }
Exemplo n.º 2
0
        public static void AddRecHeaderToDatabase(
            OaiPmhContext context, 
            Header header, 
            OAIDataProvider dataProvider, 
            bool createNewIdentifier, 
            string identifierBase)
        {
            header.OAIDataProviderId = dataProvider.OAIDataProviderId;
            context.Header.Add(header);
            context.SaveChanges();

            if (createNewIdentifier)
            {
                if(identifierBase.ElementAt(identifierBase.Length -1) != ':')
                {
                    identifierBase += ':';
                }

                header.OAI_Identifier = identifierBase + header.HeaderId;
                context.Entry(header).State = System.Data.EntityState.Modified;
            }
        }
Exemplo n.º 3
0
 public RecordQueryResult(Header header, Metadata metadata, IEnumerable<Metadata> about)
 {
     this.Header = header;
     this.Metadata = metadata;
     this.About = about == null ? null : about.ToList();
 }
Exemplo n.º 4
0
 public RecordQueryResult(Header header, Metadata metadata)
 {
     this.Header = header;
     this.Metadata = metadata;
 }
Exemplo n.º 5
0
 public static async Task<XElement> HeaderItemAsync(Header rec, string granularity)
 {
     return await Task.Run<XElement>(() => HeaderItem(rec, granularity)).ConfigureAwait(false);
 }