示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Repository&lt;T&gt;"/> class.
        /// </summary>
        /// <param name="dataCommandProvider">The data session.</param>
        /// <param name="objectFinder">The object finder.</param>
        /// <param name="repositoryStrictness">The strictness of the repository.</param>
        public Repository(
            IDataCommandProvider dataCommandProvider,
            IObjectFinder <T> objectFinder,
            RepositoryStrictness repositoryStrictness = RepositoryStrictness.Strict)
        {
            Guard.Will.ThrowException("No unit of work was available.").When(dataCommandProvider == null);

            this.DataCommandProvider  = dataCommandProvider;
            this.objectFinder         = objectFinder;
            this.repositoryStrictness = repositoryStrictness;
        }
 public StrictAggregateRootTestModelRepository(IDataCommandProvider dataCommandProvider, IObjectFinder <AggregateRootTestModel> objectFinder)
     : base(dataCommandProvider, objectFinder, RepositoryStrictness.Strict)
 {
 }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TestModelRepository"/> class.
 /// </summary>
 /// <param name="dataCommandProvider">The data session.</param>
 /// <param name="objectFinder">The object finder.</param>
 public TestModelRepository(IDataCommandProvider dataCommandProvider, IObjectFinder <TestModel> objectFinder)
     : base(dataCommandProvider, objectFinder, RepositoryStrictness.Open)
 {
 }