What are best practices to configure following class with spring.NET?
using System.Collections.Generic;
using Edu3.DTOModel;
namespace Edu3.Data.SubsonicProvider.RepositoryFramework
{
public static class RepositoryFactory
{
private static readonly Dictionary<string, object> Repositories =
new Dictionary<string, object>();
static RepositoryFactory()
{
Repositories.Add(typeof(ISsoUrlTemplateRepository).Name,
new SsoUrlTemplateRepository());
Repositories.Add(typeof(IPackageSessionNodeRepository).Name,
new PackageSessionNodeRepository());
Repositories.Add(typeof(IPackageSessionNodeFinishedRepository).Name,
new PackageSessionNodeFinishedRepository());
}
public static IRepository<TEntity> GetRepository<TEntity, TRepository>()
where TEntity : IEntity
{
var interfaceShortName = typeof(TRepository).Name;
// The provider was in the cache, so retrieve it
var repository = (IRepository<TEntity>)Repositories[interfaceShortName];
return repository;
}
}
}
I would like to add the repositories with Spring.NET. Is this possible?