From ec63e13bbe3078ee1594a00e30224ffff22c6c64 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 10 Nov 2016 23:25:21 -0500 Subject: more portable restructuring --- .../Persistence/TypeMapper.cs | 47 ---------------------- 1 file changed, 47 deletions(-) delete mode 100644 MediaBrowser.Server.Implementations/Persistence/TypeMapper.cs (limited to 'MediaBrowser.Server.Implementations/Persistence/TypeMapper.cs') diff --git a/MediaBrowser.Server.Implementations/Persistence/TypeMapper.cs b/MediaBrowser.Server.Implementations/Persistence/TypeMapper.cs deleted file mode 100644 index 2de02d817..000000000 --- a/MediaBrowser.Server.Implementations/Persistence/TypeMapper.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using System.Collections.Concurrent; -using System.Linq; - -namespace MediaBrowser.Server.Implementations.Persistence -{ - /// - /// Class TypeMapper - /// - public class TypeMapper - { - /// - /// This holds all the types in the running assemblies so that we can de-serialize properly when we don't have strong types - /// - private readonly ConcurrentDictionary _typeMap = new ConcurrentDictionary(); - - /// - /// Gets the type. - /// - /// Name of the type. - /// Type. - /// - public Type GetType(string typeName) - { - if (string.IsNullOrEmpty(typeName)) - { - throw new ArgumentNullException(); - } - - return _typeMap.GetOrAdd(typeName, LookupType); - } - - /// - /// Lookups the type. - /// - /// Name of the type. - /// Type. - private Type LookupType(string typeName) - { - return AppDomain - .CurrentDomain - .GetAssemblies() - .Select(a => a.GetType(typeName, false)) - .FirstOrDefault(t => t != null); - } - } -} -- cgit v1.2.3