コード例 #1
0
 public UnitOfWork(ExpertSystemContext context,
                   IArtistRepository artistRepository,
                   IGenericRepository <Genre> genreRepository,
                   IGenericRepository <Instrument> instrumentRepository,
                   IGenericRepository <Tempo> tempoRepository,
                   IGenericRepository <Novelty> noveltyRepository)
 {
     _context    = context ?? throw new ArgumentNullException($"No instance of {nameof(ExpertSystemContext)} provided.");
     Artists     = artistRepository ?? throw new ArgumentNullException($"No instance of {nameof(IArtistRepository)} provided.");
     Genres      = genreRepository ?? throw new ArgumentNullException($"No instance of {nameof(IGenericRepository<Genre>)} provided.");
     Instruments = instrumentRepository ?? throw new ArgumentNullException($"No instance of {nameof(IGenericRepository<Instrument>)} provided.");
     Tempos      = tempoRepository ?? throw new ArgumentNullException($"No instance of {nameof(IGenericRepository<Tempo>)} provided.");
     Novelties   = noveltyRepository ?? throw new ArgumentNullException($"No instance of {nameof(IGenericRepository<Novelty>)} provided.");
 }
コード例 #2
0
ファイル: ArtistRepository.cs プロジェクト: zeldon-0/AOIS1
 public ArtistRepository(ExpertSystemContext context) : base(context)
 {
     _context = context ?? throw new ArgumentNullException($"No instance of {nameof(ExpertSystemContext)} provided.");
 }