/// <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; }
public MyRepository(IUnitOfWorkDocument <TContext> unitOfWork, string collectionName, KeyValuePair <string, Type> IdFieldMetadata) : base(unitOfWork, collectionName, IdFieldMetadata) { }