public UserMessagesService( CampaignsDbContext dbContext, IOptions <CampaignsApiOptions> apiOptions, IOptions <GeneralSettings> generalSettings ) { DbContext = dbContext ?? throw new ArgumentNullException(nameof(dbContext)); ApiOptions = apiOptions?.Value ?? throw new ArgumentNullException(nameof(apiOptions)); GeneralSettings = generalSettings?.Value ?? throw new ArgumentNullException(nameof(generalSettings)); }
public CampaignService( CampaignsDbContext dbContext, IOptions <GeneralSettings> generalSettings, IOptions <CampaignsApiOptions> apiOptions, Func <string, IFileService> getFileService, IHttpContextAccessor httpContextAccessor, LinkGenerator linkGenerator ) { DbContext = dbContext ?? throw new ArgumentNullException(nameof(dbContext)); ApiOptions = apiOptions?.Value ?? throw new ArgumentNullException(nameof(apiOptions)); FileService = getFileService(CampaignsApi.FileServiceKey) ?? throw new ArgumentNullException(nameof(getFileService)); GeneralSettings = generalSettings?.Value ?? throw new ArgumentNullException(nameof(generalSettings)); HttpContextAccessor = httpContextAccessor ?? throw new ArgumentNullException(nameof(httpContextAccessor)); LinkGenerator = linkGenerator ?? throw new ArgumentNullException(nameof(linkGenerator)); }
public CampaignService(CampaignsDbContext dbcontext, IConfiguration Configuration) { _dbcontext = dbcontext; _Configuration = Configuration; }
public static IEnumerable <Campaigns.Model.AttributeContribution> GetContributionsFromAttribute(this CampaignsDbContext db, int id) { return(db.AttributeContributions.Where(c => c.SourceId == id)); }
public static IEnumerable <Campaigns.Model.Attribute> GetStandardAttributes(this CampaignsDbContext db) { return(db.Attributes.Where(a => a.IsStandard)); }
public static IEnumerable <Campaigns.Model.Attribute> GetAttributesInCategory(this CampaignsDbContext db, string category) { return(db.Attributes.Where(a => 0 == string.Compare(a.Category, category, true))); }
// // DEPRECATED // public static Campaigns.Model.Attribute GetAttribute(this CampaignsDbContext db, string name, string category) { return(db.Attributes .FirstOrDefault(a => 0 == string.Compare(a.Name, name, true) && 0 == string.Compare(a.Category, category, true))); }