diff --git a/MediaBrowser.Api/LibraryService.cs b/MediaBrowser.Api/LibraryService.cs index 585bfd45d1..bcf87ab674 100644 --- a/MediaBrowser.Api/LibraryService.cs +++ b/MediaBrowser.Api/LibraryService.cs @@ -1,5 +1,4 @@ -using MediaBrowser.Common.Mef; -using MediaBrowser.Common.Net; +using MediaBrowser.Common.Net; using MediaBrowser.Controller; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; @@ -213,7 +212,7 @@ namespace MediaBrowser.Api { var kernel = (Kernel)Kernel; - var allTypes = kernel.Assemblies.SelectMany(MefUtils.GetTypes).Where(t => !t.IsAbstract && t.IsSubclassOf(typeof(BaseItem))); + var allTypes = kernel.AllTypes.Where(t => !t.IsAbstract && t.IsSubclassOf(typeof(BaseItem))); if (request.HasInternetProvider) { diff --git a/MediaBrowser.Common/Kernel/BaseKernel.cs b/MediaBrowser.Common/Kernel/BaseKernel.cs index 2b39864089..91965e4690 100644 --- a/MediaBrowser.Common/Kernel/BaseKernel.cs +++ b/MediaBrowser.Common/Kernel/BaseKernel.cs @@ -1,7 +1,5 @@ using MediaBrowser.Common.Events; using MediaBrowser.Common.IO; -using MediaBrowser.Common.Localization; -using MediaBrowser.Common.Mef; using MediaBrowser.Common.Net; using MediaBrowser.Common.Plugins; using MediaBrowser.Common.ScheduledTasks; @@ -13,12 +11,14 @@ using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.ComponentModel.Composition.Hosting; +using System.ComponentModel.Composition.Primitives; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Threading; using System.Threading.Tasks; +using SimpleInjector; namespace MediaBrowser.Common.Kernel { @@ -200,13 +200,6 @@ namespace MediaBrowser.Common.Kernel [ImportMany(typeof(IWebSocketListener))] public IEnumerable WebSocketListeners { get; private set; } - /// - /// Gets the list of Localized string files - /// - /// The string files. - [ImportMany(typeof(LocalizedStringData))] - public IEnumerable StringFiles { get; private set; } - /// /// Gets the MEF CompositionContainer /// @@ -241,7 +234,6 @@ namespace MediaBrowser.Common.Kernel /// Gets the rest services. /// /// The rest services. - [ImportMany(typeof(IRestfulService))] public IEnumerable RestServices { get; private set; } /// @@ -265,7 +257,7 @@ namespace MediaBrowser.Common.Kernel get { // Lazy load - LazyInitializer.EnsureInitialized(ref _protobufSerializer, ref _protobufSerializerInitialized, ref _protobufSerializerSyncLock, () => DynamicProtobufSerializer.Create(Assemblies)); + LazyInitializer.EnsureInitialized(ref _protobufSerializer, ref _protobufSerializerInitialized, ref _protobufSerializerSyncLock, () => DynamicProtobufSerializer.Create(AllTypes)); return _protobufSerializer; } private set @@ -341,6 +333,12 @@ namespace MediaBrowser.Common.Kernel /// The assemblies. public Assembly[] Assemblies { get; private set; } + /// + /// Gets all types. + /// + /// All types. + public Type[] AllTypes { get; private set; } + /// /// Initializes a new instance of the class. /// @@ -460,25 +458,83 @@ namespace MediaBrowser.Common.Kernel Assemblies = GetComposablePartAssemblies().ToArray(); - CompositionContainer = MefUtils.GetSafeCompositionContainer(Assemblies.Select(i => new AssemblyCatalog(i))); + AllTypes = Assemblies.SelectMany(GetTypes).ToArray(); - ComposeExportedValues(CompositionContainer); - - CompositionContainer.ComposeParts(this); + ComposeParts(AllTypes); await OnComposablePartsLoaded().ConfigureAwait(false); CompositionContainer.Catalog.Dispose(); } + /// + /// The ioc container + /// + private readonly Container _iocContainer = new Container(); + + /// + /// Composes the parts. + /// + /// All types. + private void ComposeParts(IEnumerable allTypes) + { + var concreteTypes = allTypes.Where(t => t.IsClass && !t.IsAbstract && !t.IsInterface && !t.IsGenericType).ToArray(); + + CompositionContainer = GetSafeCompositionContainer(concreteTypes.Select(i => new TypeCatalog(i))); + + ComposeExportedValues(CompositionContainer, _iocContainer); + + CompositionContainer.ComposeParts(this); + + ComposePartsWithIocContainer(concreteTypes, _iocContainer); + } + + /// + /// Composes the parts with ioc container. + /// + /// All types. + /// The container. + protected virtual void ComposePartsWithIocContainer(Type[] allTypes, Container container) + { + RestServices = GetExports(allTypes); + } + + /// + /// Gets the exports. + /// + /// + /// All types. + /// IEnumerable{``0}. + protected IEnumerable GetExports(Type[] allTypes) + { + var currentType = typeof(T); + + Logger.Info("Composing instances of " + currentType.Name); + + return allTypes.Where(currentType.IsAssignableFrom).Select(Instantiate).Cast().ToArray(); + } + + /// + /// Instantiates the specified type. + /// + /// The type. + /// System.Object. + private object Instantiate(Type type) + { + return _iocContainer.GetInstance(type); + } + /// /// Composes the exported values. /// /// The container. - protected virtual void ComposeExportedValues(CompositionContainer container) + protected virtual void ComposeExportedValues(CompositionContainer container, Container iocContainer) { container.ComposeExportedValue("logger", Logger); container.ComposeExportedValue("appHost", ApplicationHost); + + iocContainer.RegisterSingle(Logger); + iocContainer.RegisterSingle(ApplicationHost); } /// @@ -545,6 +601,71 @@ namespace MediaBrowser.Common.Kernel yield return GetType().Assembly; } + /// + /// Plugins that live on both the server and UI are going to have references to assemblies from both sides. + /// But looks for Parts on one side, it will throw an exception when it seems Types from the other side that it doesn't have a reference to. + /// For example, a plugin provides a Resolver. When MEF runs in the UI, it will throw an exception when it sees the resolver because there won't be a reference to the base class. + /// This method will catch those exceptions while retining the list of Types that MEF is able to resolve. + /// + /// The catalogs. + /// CompositionContainer. + /// catalogs + private static CompositionContainer GetSafeCompositionContainer(IEnumerable catalogs) + { + if (catalogs == null) + { + throw new ArgumentNullException("catalogs"); + } + + var newList = new List(); + + // Go through each Catalog + foreach (var catalog in catalogs) + { + try + { + // Try to have MEF find Parts + catalog.Parts.ToArray(); + + // If it succeeds we can use the entire catalog + newList.Add(catalog); + } + catch (ReflectionTypeLoadException ex) + { + // If it fails we can still get a list of the Types it was able to resolve and create TypeCatalogs + var typeCatalogs = ex.Types.Where(t => t != null).Select(t => new TypeCatalog(t)); + newList.AddRange(typeCatalogs); + } + } + + return new CompositionContainer(new AggregateCatalog(newList)); + } + + /// + /// Gets a list of types within an assembly + /// This will handle situations that would normally throw an exception - such as a type within the assembly that depends on some other non-existant reference + /// + /// The assembly. + /// IEnumerable{Type}. + /// assembly + private static IEnumerable GetTypes(Assembly assembly) + { + if (assembly == null) + { + throw new ArgumentNullException("assembly"); + } + + try + { + return assembly.GetTypes(); + } + catch (ReflectionTypeLoadException ex) + { + // If it fails we can still get a list of the Types it was able to resolve + return ex.Types.Where(t => t != null); + } + } + /// /// Fires after MEF finishes finding composable parts within plugin assemblies /// diff --git a/MediaBrowser.Common/MediaBrowser.Common.csproj b/MediaBrowser.Common/MediaBrowser.Common.csproj index 9ad4a12736..12c76cff65 100644 --- a/MediaBrowser.Common/MediaBrowser.Common.csproj +++ b/MediaBrowser.Common/MediaBrowser.Common.csproj @@ -88,6 +88,9 @@ False ..\packages\ServiceStack.Text.3.9.37\lib\net35\ServiceStack.Text.dll + + ..\packages\SimpleInjector.2.0.0-beta5\lib\net40-client\SimpleInjector.dll + @@ -139,7 +142,6 @@ - diff --git a/MediaBrowser.Common/Mef/MefUtils.cs b/MediaBrowser.Common/Mef/MefUtils.cs deleted file mode 100644 index 744f6cd809..0000000000 --- a/MediaBrowser.Common/Mef/MefUtils.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.Composition.Hosting; -using System.ComponentModel.Composition.Primitives; -using System.Linq; -using System.Reflection; - -namespace MediaBrowser.Common.Mef -{ - /// - /// Class MefUtils - /// - public static class MefUtils - { - /// - /// Plugins that live on both the server and UI are going to have references to assemblies from both sides. - /// But looks for Parts on one side, it will throw an exception when it seems Types from the other side that it doesn't have a reference to. - /// For example, a plugin provides a Resolver. When MEF runs in the UI, it will throw an exception when it sees the resolver because there won't be a reference to the base class. - /// This method will catch those exceptions while retining the list of Types that MEF is able to resolve. - /// - /// The catalogs. - /// CompositionContainer. - /// catalogs - public static CompositionContainer GetSafeCompositionContainer(IEnumerable catalogs) - { - if (catalogs == null) - { - throw new ArgumentNullException("catalogs"); - } - - var newList = new List(); - - // Go through each Catalog - foreach (var catalog in catalogs) - { - try - { - // Try to have MEF find Parts - catalog.Parts.ToArray(); - - // If it succeeds we can use the entire catalog - newList.Add(catalog); - } - catch (ReflectionTypeLoadException ex) - { - // If it fails we can still get a list of the Types it was able to resolve and create TypeCatalogs - var typeCatalogs = ex.Types.Where(t => t != null).Select(t => new TypeCatalog(t)); - newList.AddRange(typeCatalogs); - } - } - - return new CompositionContainer(new AggregateCatalog(newList)); - } - - /// - /// Gets a list of types within an assembly - /// This will handle situations that would normally throw an exception - such as a type within the assembly that depends on some other non-existant reference - /// - /// The assembly. - /// IEnumerable{Type}. - /// assembly - public static IEnumerable GetTypes(Assembly assembly) - { - if (assembly == null) - { - throw new ArgumentNullException("assembly"); - } - - try - { - return assembly.GetTypes(); - } - catch (ReflectionTypeLoadException ex) - { - // If it fails we can still get a list of the Types it was able to resolve - return ex.Types.Where(t => t != null); - } - } - } -} diff --git a/MediaBrowser.Common/Serialization/DynamicProtobufSerializer.cs b/MediaBrowser.Common/Serialization/DynamicProtobufSerializer.cs index f83b31322c..359cf9da06 100644 --- a/MediaBrowser.Common/Serialization/DynamicProtobufSerializer.cs +++ b/MediaBrowser.Common/Serialization/DynamicProtobufSerializer.cs @@ -1,11 +1,9 @@ -using MediaBrowser.Common.Mef; -using ProtoBuf; +using ProtoBuf; using ProtoBuf.Meta; using System; using System.Collections.Generic; using System.IO; using System.Linq; -using System.Reflection; namespace MediaBrowser.Common.Serialization { @@ -135,21 +133,20 @@ namespace MediaBrowser.Common.Serialization /// /// Creates the specified assemblies. /// - /// The assemblies. /// DynamicProtobufSerializer. /// assemblies - public static DynamicProtobufSerializer Create(IEnumerable assemblies) + public static DynamicProtobufSerializer Create(IEnumerable types) { - if (assemblies == null) + if (types == null) { - throw new ArgumentNullException("assemblies"); + throw new ArgumentNullException("types"); } var model = TypeModel.Create(); var attributeType = typeof(ProtoContractAttribute); // Find all ProtoContracts in the current assembly - foreach (var type in assemblies.SelectMany(a => MefUtils.GetTypes(a).Where(t => Attribute.IsDefined(t, attributeType)))) + foreach (var type in types.Where(t => Attribute.IsDefined(t, attributeType))) { model.Add(type, true); } diff --git a/MediaBrowser.Common/packages.config b/MediaBrowser.Common/packages.config index 536640094c..96fdb618b8 100644 --- a/MediaBrowser.Common/packages.config +++ b/MediaBrowser.Common/packages.config @@ -13,4 +13,5 @@ + \ No newline at end of file diff --git a/MediaBrowser.Controller/Kernel.cs b/MediaBrowser.Controller/Kernel.cs index 952160b2b7..ea868ec454 100644 --- a/MediaBrowser.Controller/Kernel.cs +++ b/MediaBrowser.Controller/Kernel.cs @@ -1,5 +1,6 @@ using MediaBrowser.Common.IO; using MediaBrowser.Common.Kernel; +using MediaBrowser.Common.Localization; using MediaBrowser.Common.Plugins; using MediaBrowser.Controller.Drawing; using MediaBrowser.Controller.Entities; @@ -27,6 +28,7 @@ using System.ComponentModel.Composition.Hosting; using System.Linq; using System.Threading; using System.Threading.Tasks; +using SimpleInjector; namespace MediaBrowser.Controller { @@ -178,25 +180,29 @@ namespace MediaBrowser.Controller get { return KernelContext.Server; } } + /// + /// Gets the list of Localized string files + /// + /// The string files. + [ImportMany(typeof(LocalizedStringData))] + public IEnumerable StringFiles { get; private set; } + /// /// Gets the list of plugin configuration pages /// /// The configuration pages. - [ImportMany(typeof(IPluginConfigurationPage))] public IEnumerable PluginConfigurationPages { get; private set; } /// /// Gets the intro providers. /// /// The intro providers. - [ImportMany(typeof(IIntroProvider))] public IEnumerable IntroProviders { get; private set; } /// /// Gets the list of currently registered weather prvoiders /// /// The weather providers. - [ImportMany(typeof(IWeatherProvider))] public IEnumerable WeatherProviders { get; private set; } /// @@ -232,7 +238,6 @@ namespace MediaBrowser.Controller /// Gets the list of available user repositories /// /// The user repositories. - [ImportMany(typeof(IUserRepository))] private IEnumerable UserRepositories { get; set; } /// @@ -251,7 +256,6 @@ namespace MediaBrowser.Controller /// Gets the list of available item repositories /// /// The item repositories. - [ImportMany(typeof(IItemRepository))] private IEnumerable ItemRepositories { get; set; } /// @@ -264,22 +268,19 @@ namespace MediaBrowser.Controller /// Gets the list of available item repositories /// /// The user data repositories. - [ImportMany(typeof(IUserDataRepository))] private IEnumerable UserDataRepositories { get; set; } /// /// Gets the list of available DisplayPreferencesRepositories /// /// The display preferences repositories. - [ImportMany(typeof(IDisplayPreferencesRepository))] private IEnumerable DisplayPreferencesRepositories { get; set; } /// /// Gets the list of entity resolution ignore rules /// /// The entity resolution ignore rules. - [ImportMany(typeof(BaseResolutionIgnoreRule))] - internal IEnumerable EntityResolutionIgnoreRules { get; private set; } + internal IEnumerable EntityResolutionIgnoreRules { get; private set; } /// /// Gets the active user data repository @@ -357,12 +358,35 @@ namespace MediaBrowser.Controller /// Composes the exported values. /// /// The container. - protected override void ComposeExportedValues(CompositionContainer container) + /// The _ioc container. + protected override void ComposeExportedValues(CompositionContainer container, Container iocContainer) { - base.ComposeExportedValues(container); + base.ComposeExportedValues(container, iocContainer); container.ComposeExportedValue("kernel", this); container.ComposeExportedValue("blurayExaminer", BlurayExaminer); + + iocContainer.RegisterSingle(this); + iocContainer.RegisterSingle(BlurayExaminer); + } + + /// + /// Composes the parts with ioc container. + /// + /// All types. + /// The container. + protected override void ComposePartsWithIocContainer(Type[] allTypes, Container container) + { + base.ComposePartsWithIocContainer(allTypes, container); + + EntityResolutionIgnoreRules = GetExports(allTypes); + UserDataRepositories = GetExports(allTypes); + UserRepositories = GetExports(allTypes); + DisplayPreferencesRepositories = GetExports(allTypes); + ItemRepositories = GetExports(allTypes); + WeatherProviders = GetExports(allTypes); + IntroProviders = GetExports(allTypes); + PluginConfigurationPages = GetExports(allTypes); } /// diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index 3978e6e397..f962427cdd 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -63,6 +63,10 @@ False ..\packages\protobuf-net.2.0.0.621\lib\net40\protobuf-net.dll + + False + ..\packages\SimpleInjector.2.0.0-beta5\lib\net40-client\SimpleInjector.dll + @@ -165,7 +169,7 @@ - + diff --git a/MediaBrowser.Controller/Resolvers/CoreResolutionIgnoreRule.cs b/MediaBrowser.Controller/Resolvers/CoreResolutionIgnoreRule.cs index 2d69f8deff..d237f68f32 100644 --- a/MediaBrowser.Controller/Resolvers/CoreResolutionIgnoreRule.cs +++ b/MediaBrowser.Controller/Resolvers/CoreResolutionIgnoreRule.cs @@ -9,8 +9,8 @@ namespace MediaBrowser.Controller.Resolvers /// /// Provides the core resolver ignore rules /// - [Export(typeof(BaseResolutionIgnoreRule))] - public class CoreResolutionIgnoreRule : BaseResolutionIgnoreRule + [Export(typeof(IResolutionIgnoreRule))] + public class CoreResolutionIgnoreRule : IResolutionIgnoreRule { /// /// Any folder named in this list will be ignored - can be added to at runtime for extensibility @@ -27,7 +27,7 @@ namespace MediaBrowser.Controller.Resolvers "extrafanart" }; - public override bool ShouldIgnore(ItemResolveArgs args) + public bool ShouldIgnore(ItemResolveArgs args) { // Ignore hidden files and folders if (args.IsHidden) diff --git a/MediaBrowser.Controller/Resolvers/BaseResolutionIgnoreRule.cs b/MediaBrowser.Controller/Resolvers/IResolutionIgnoreRule.cs similarity index 66% rename from MediaBrowser.Controller/Resolvers/BaseResolutionIgnoreRule.cs rename to MediaBrowser.Controller/Resolvers/IResolutionIgnoreRule.cs index 45effc4da1..661688f3c7 100644 --- a/MediaBrowser.Controller/Resolvers/BaseResolutionIgnoreRule.cs +++ b/MediaBrowser.Controller/Resolvers/IResolutionIgnoreRule.cs @@ -5,8 +5,8 @@ namespace MediaBrowser.Controller.Resolvers /// /// Provides a base "rule" that anyone can use to have paths ignored by the resolver /// - public abstract class BaseResolutionIgnoreRule + public interface IResolutionIgnoreRule { - public abstract bool ShouldIgnore(ItemResolveArgs args); + bool ShouldIgnore(ItemResolveArgs args); } } diff --git a/MediaBrowser.Controller/packages.config b/MediaBrowser.Controller/packages.config index e3e4367b73..6fd19eed96 100644 --- a/MediaBrowser.Controller/packages.config +++ b/MediaBrowser.Controller/packages.config @@ -2,4 +2,5 @@ + \ No newline at end of file diff --git a/MediaBrowser.Server.Sqlite/MediaBrowser.Server.Sqlite.csproj b/MediaBrowser.Server.Sqlite/MediaBrowser.Server.Sqlite.csproj index f4fb64ea57..22e552f8ae 100644 --- a/MediaBrowser.Server.Sqlite/MediaBrowser.Server.Sqlite.csproj +++ b/MediaBrowser.Server.Sqlite/MediaBrowser.Server.Sqlite.csproj @@ -36,7 +36,6 @@ - ..\packages\System.Data.SQLite.1.0.84.0\lib\net45\System.Data.SQLite.dll diff --git a/MediaBrowser.Server.Sqlite/SQLiteDisplayPreferencesRepository.cs b/MediaBrowser.Server.Sqlite/SQLiteDisplayPreferencesRepository.cs index 4ef4cf0862..80d389c941 100644 --- a/MediaBrowser.Server.Sqlite/SQLiteDisplayPreferencesRepository.cs +++ b/MediaBrowser.Server.Sqlite/SQLiteDisplayPreferencesRepository.cs @@ -5,7 +5,6 @@ using MediaBrowser.Model.Entities; using MediaBrowser.Model.Logging; using System; using System.Collections.Generic; -using System.ComponentModel.Composition; using System.Data; using System.IO; using System.Threading; @@ -16,7 +15,6 @@ namespace MediaBrowser.Server.Sqlite /// /// Class SQLiteDisplayPreferencesRepository /// - [Export(typeof(IDisplayPreferencesRepository))] class SQLiteDisplayPreferencesRepository : SqliteRepository, IDisplayPreferencesRepository { /// @@ -40,8 +38,7 @@ namespace MediaBrowser.Server.Sqlite /// Initializes a new instance of the class. /// /// The logger. - [ImportingConstructor] - protected SQLiteDisplayPreferencesRepository([Import("logger")] ILogger logger) + public SQLiteDisplayPreferencesRepository(ILogger logger) : base(logger) { } diff --git a/MediaBrowser.Server.Sqlite/SQLiteItemRepository.cs b/MediaBrowser.Server.Sqlite/SQLiteItemRepository.cs index d00bd63ce5..58a924bc4b 100644 --- a/MediaBrowser.Server.Sqlite/SQLiteItemRepository.cs +++ b/MediaBrowser.Server.Sqlite/SQLiteItemRepository.cs @@ -5,7 +5,6 @@ using MediaBrowser.Controller.Persistence; using MediaBrowser.Model.Logging; using System; using System.Collections.Generic; -using System.ComponentModel.Composition; using System.Data; using System.IO; using System.Threading; @@ -16,7 +15,6 @@ namespace MediaBrowser.Server.Sqlite /// /// Class SQLiteItemRepository /// - [Export(typeof(IItemRepository))] public class SQLiteItemRepository : SqliteRepository, IItemRepository { /// @@ -45,8 +43,7 @@ namespace MediaBrowser.Server.Sqlite /// Initializes a new instance of the class. /// /// The logger. - [ImportingConstructor] - protected SQLiteItemRepository([Import("logger")] ILogger logger) + public SQLiteItemRepository(ILogger logger) : base(logger) { } diff --git a/MediaBrowser.Server.Sqlite/SQLiteUserDataRepository.cs b/MediaBrowser.Server.Sqlite/SQLiteUserDataRepository.cs index 732ebc06c0..eaa89508a5 100644 --- a/MediaBrowser.Server.Sqlite/SQLiteUserDataRepository.cs +++ b/MediaBrowser.Server.Sqlite/SQLiteUserDataRepository.cs @@ -4,7 +4,6 @@ using MediaBrowser.Controller.Persistence; using MediaBrowser.Model.Logging; using System; using System.Collections.Generic; -using System.ComponentModel.Composition; using System.Data; using System.IO; using System.Threading; @@ -15,7 +14,6 @@ namespace MediaBrowser.Server.Sqlite /// /// Class SQLiteUserDataRepository /// - [Export(typeof(IUserDataRepository))] public class SQLiteUserDataRepository : SqliteRepository, IUserDataRepository { /// @@ -39,8 +37,7 @@ namespace MediaBrowser.Server.Sqlite /// Initializes a new instance of the class. /// /// The logger. - [ImportingConstructor] - protected SQLiteUserDataRepository([Import("logger")] ILogger logger) + public SQLiteUserDataRepository(ILogger logger) : base(logger) { } diff --git a/MediaBrowser.Server.Sqlite/SQLiteUserRepository.cs b/MediaBrowser.Server.Sqlite/SQLiteUserRepository.cs index 8788a488fd..6c0de21615 100644 --- a/MediaBrowser.Server.Sqlite/SQLiteUserRepository.cs +++ b/MediaBrowser.Server.Sqlite/SQLiteUserRepository.cs @@ -4,7 +4,6 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Persistence; using System; using System.Collections.Generic; -using System.ComponentModel.Composition; using System.Data; using System.IO; using System.Threading; @@ -16,7 +15,6 @@ namespace MediaBrowser.Server.Sqlite /// /// Class SQLiteUserRepository /// - [Export(typeof(IUserRepository))] public class SQLiteUserRepository : SqliteRepository, IUserRepository { /// @@ -40,8 +38,7 @@ namespace MediaBrowser.Server.Sqlite /// Initializes a new instance of the class. /// /// The logger. - [ImportingConstructor] - protected SQLiteUserRepository([Import("logger")] ILogger logger) + public SQLiteUserRepository(ILogger logger) : base(logger) { }