コード例 #1
0
        private void add(BundleEntry entry)
        {
            string name = null;

            if (entry is DeletedEntry)
            {
                name = "deleted";
            }
            else if (entry is ResourceEntry)
            {
                name = ((ResourceEntry)entry).Resource.GetCollectionName();
            }
            else
            {
                throw new ArgumentException("Cannot import BundleEntry of type " + entry.GetType().ToString());
            }

            List <BundleEntry> resources;

            if (ImportedEntries.ContainsKey(name))
            {
                resources = ImportedEntries[name];
            }
            else
            {
                resources = new List <BundleEntry>();
                ImportedEntries.Add(name, resources);
            }

            resources.Add(entry);
        }
コード例 #2
0
 public static string TypeName(this BundleEntry entry)
 {
     if (entry is DeletedEntry)
     {
         return("DeletedEntry");
     }
     else if (entry is ResourceEntry)
     {
         return("ResourceEntry");
     }
     else
     {
         throw new ArgumentException("Unsupported BundleEntry type: " + entry.GetType().Name);
     }
 }
コード例 #3
0
ファイル: MongoFhirStore.cs プロジェクト: HowardEdidin/spark
 private string getEntryTypeFromInstance(BundleEntry entry)
 {
     if (entry is DeletedEntry)
     {
         return("DeletedEntry");
     }
     else if (entry is ResourceEntry)
     {
         return("ResourceEntry");
     }
     else
     {
         throw new ArgumentException("Unsupported BundleEntry type: " + entry.GetType().Name);
     }
 }