コード例 #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="unitOfWork">UnitOfWork Instace object</param>
        public RepositoryMongo(IUnitOfWorkDocument <TContext> unitOfWork, string collectionName, KeyValuePair <string, Type> IdFieldMetadata)
        {
            if (unitOfWork == null)
            {
                throw new NullReferenceException("Unit of Work object is Null.");
            }
            this.unitOfWorkMongo = unitOfWork;

            if (string.IsNullOrEmpty(collectionName))
            {
                throw new NullReferenceException("Collection name is not informed");
            }
            this.collectionName = collectionName;

            if (string.IsNullOrEmpty(IdFieldMetadata.Key) || IdFieldMetadata.Value == null)
            {
                throw new NullReferenceException("IdField Metadata is not corretaly informed");
            }
            this.idFieldMetadata = IdFieldMetadata;
        }
コード例 #2
0
 public MyRepository(IUnitOfWorkDocument <TContext> unitOfWork, string collectionName, KeyValuePair <string, Type> IdFieldMetadata)
     : base(unitOfWork, collectionName, IdFieldMetadata)
 {
 }