Пример #1
0
        public InMemoryRepository(
            InMemoryRepositoryOptions <TEntity> options,
            Func <TDestination, object> idSelector)
            : base(options)
        {
            EnsureArg.IsNotNull(idSelector, nameof(idSelector));

            this.idSelector = idSelector; // TODO: really needed?
        }
Пример #2
0
        public InMemoryRepository(InMemoryRepositoryOptions <TEntity> options)
        {
            EnsureArg.IsNotNull(options, nameof(options));

            this.Options = options;
            this.Logger  = options.CreateLogger <IGenericRepository <TEntity> >();
            this.Options.Context ??= new InMemoryContext <TEntity>();
            this.Options.IdGenerator ??= new InMemoryEntityIdGenerator <TEntity>(this.Options.Context);
        }