public IRepositoryWithGuidKey <TEntity> GetRepository <TEntity>() where TEntity : EventWithGuidKey { Type entityType = typeof(TEntity); IRepositoryWithGuidKey <TEntity> repository = _repositories.ContainsKey(entityType) ? _repositories[entityType] as IRepositoryWithGuidKey <TEntity> : null; return(repository); }
public PersonService(IValidation <RegisterNewPersonCommand> registerNewPersonValidation, IValidation <UpdatePersonCommand> updatePersonValidation, IDomainNotificationHandler notifications, IUnitOfWork uow, IRepositoryWithGuidKey <PersonDomain> repository) : base(repository, notifications, registerNewPersonValidation, updatePersonValidation, uow) { }
public void UseRepository <TEntity>(IRepositoryWithGuidKey <TEntity> repository) where TEntity : EntityWithGuidKey { _repositories[typeof(TEntity)] = repository; }