Example #1
0
        public TagRepository(ISimpleBlogDbContext simpleBlogDbContext)
        {
            if (simpleBlogDbContext == null)
            {
                throw new ArgumentNullException(nameof(simpleBlogDbContext));
            }

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

            _mongoCollection = simpleBlogDbContext.CreateCollection <User>();

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