Ejemplo n.º 1
0
 private Type GetEntityType(Persistence.IEntityType entityType)
 {
     if (cachedEntityTypes.TryGetValue(entityType.Id, out Type type) == false)
     {
         type = this.ExtractEntityType(entityType);
         cachedEntityTypes.Add(entityType.Id, type);
     }
     return(type);
 }
Ejemplo n.º 2
0
 public EntityType(
     Persistence.IEntityType entityType,
     IExternalSystem destinationSystem,
     IEnumerable <IExternalSystem> sharedIdentifierSourceSystems)
 {
     this.entityType        = entityType;
     this.destinationSystem = destinationSystem;
     this.type = this.GetEntityType(entityType);
     this.sharedIdentifierSourceSystems = sharedIdentifierSourceSystems;
 }
Ejemplo n.º 3
0
 private Type ExtractEntityType(Persistence.IEntityType entityType)
 {
     try
     {
         return
             (AppDomain
              .CurrentDomain
              .GetAssemblies()
              .Where(assembly => assembly.IsDynamic == false)
              .SelectMany(assembly => assembly.ExportedTypes)
              .Single(type => type.AssemblyQualifiedName == entityType.TypeName));
     }
     catch
     {
         throw new InvalidOperationException(string.Format(
                                                 Resources.InvalidEntityType,
                                                 entityType.Name,
                                                 entityType.TypeName));
     }
 }