コード例 #1
0
        public TagRepository(ISimpleBlogDbContext simpleBlogDbContext)
        {
            if (simpleBlogDbContext == null)
            {
                throw new ArgumentNullException(nameof(simpleBlogDbContext));
            }

            _mongoCollection = simpleBlogDbContext.CreateCollection <Tag>();
        }
コード例 #2
0
        public UserRepository(ISimpleBlogDbContext simpleBlogDbContext)
        {
            if (simpleBlogDbContext == null)
            {
                throw new ArgumentNullException(nameof(simpleBlogDbContext));
            }

            _mongoCollection = simpleBlogDbContext.CreateCollection <User>();

            _insertOneOptions = new InsertOneOptions()
            {
                BypassDocumentValidation = false
            };
        }