Esempio n. 1
0
        public TagRepository(ISimpleBlogDbContext simpleBlogDbContext)
        {
            if (simpleBlogDbContext == null)
            {
                throw new ArgumentNullException(nameof(simpleBlogDbContext));
            }

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

            _mongoCollection = simpleBlogDbContext.CreateCollection <User>();

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