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