/// <summary> /// Register all repository layer entities within the unity container /// </summary> /// <param name="container">The unity container in which to register</param> private static void RegisterRepositoryLayers(UnityContainer container) { //Ensure we have repositories to hand ITypedDataAccess dataAccess = container.Resolve <ITypedDataAccess>(); ISqlStringService sqlStringService = container.Resolve <ISqlStringService>(); container.RegisterType <IGoalRepository, GoalRepository>(new InjectionConstructor(dataAccess, sqlStringService)); container.RegisterType <IMilestoneRepository, MilestoneRepository>(new InjectionConstructor(dataAccess, sqlStringService)); container.RegisterType <ITransactionRepository, TransactionRepository>(new InjectionConstructor(dataAccess, sqlStringService)); }
/// <summary> /// Creates a new Goal Repository which will access /// the data store using the data access provided /// </summary> /// <param name="dataAccess">The data access for the repository</param> /// <param name="sqlStringService">The SQL string service that provides the Sql statements to be used</param> public GoalRepository(ITypedDataAccess dataAccess, ISqlStringService sqlStringService) : base(dataAccess, sqlStringService) { typedDataAccess = dataAccess; }
/// <summary> /// Creates a new Transaction Repository /// </summary> /// <param name="dataAccess">The data access for the tranaction repository</param> /// <param name="sqlStringService">The service providing SQL strings when required</param> public TransactionRepository(ITypedDataAccess dataAccess, ISqlStringService sqlStringService) : base(dataAccess, sqlStringService) { typedDataAccess = dataAccess; }
/// <summary> /// Creates a new Sql Repository Base class for any deriving classes /// </summary> /// <param name="dataAccess">The data access to be used</param> /// <param name="sqlStringService">The Sql String Provider</param> protected SqlRepositoryBase(IDataAccess dataAccess, ISqlStringService sqlStringService) : base(dataAccess) { this.sqlStringService = sqlStringService; this.LoadedResources = new Dictionary <string, Dictionary <string, string> >(); }