コード例 #1
0
        private Audience GetAudience(string name)
        {
            var    options    = new DbContextOptionsBuilder <GhDbContext>();
            string connectstr = Configuration["DbConnection"];

            options.UseSqlServer(connectstr);
            var             dbContext = new GhDbContext(options.Options);
            AudienceService service   = new AudienceService(dbContext);

            return(service.GetByName(name));
        }
コード例 #2
0
 public AudienceService(GhDbContext dbcontext)
 {
     _repository = new AudienceRepository(dbcontext);
 }
コード例 #3
0
 public AudienceRepository(GhDbContext dbContext)
 {
     _dbContext = dbContext;
 }