Example #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));
        }
Example #2
0
 public AudienceService(GhDbContext dbcontext)
 {
     _repository = new AudienceRepository(dbcontext);
 }
Example #3
0
 public AudienceRepository(GhDbContext dbContext)
 {
     _dbContext = dbContext;
 }