public async Task DeleteAsync(int id) { var record = await Dbset.FirstOrDefaultAsync(r => r.RuleSetId == id); if (record != null) { Dbset.Remove(record); } }
public async Task DeleteAsync(int ruleId, int ruleSetId) { var entity = await Dbset.FirstOrDefaultAsync(e => e.RuleId == ruleId && e.RuleSetId == ruleSetId); if (entity != null) { Dbset.Remove(entity); } }
public async Task <Article> GetFeaturedAsync(int categoryId, bool withFallback) { var record = await Dbset.FirstOrDefaultAsync(r => r.CategoryId == categoryId && r.IsFeatured); if (record == null && withFallback) { record = await Dbset.Where(r => r.CategoryId == categoryId).OrderBy(r => r.OrderId).FirstOrDefaultAsync(); } return(record); }
public async Task <Category> GetAsync(string categoryUrl, bool withFallback) { var record = await Dbset.FirstOrDefaultAsync(r => r.Url == categoryUrl && !r.Deleted); if (record == null && withFallback) { record = await Dbset.Where(r => !r.Deleted).OrderBy(r => r.OrderId).FirstOrDefaultAsync(); } return(record); }
public async Task <Article> GetByCategoryAsync(int categoryId, string articleUrl) { var record = await Dbset.FirstOrDefaultAsync(r => r.CategoryId == categoryId && r.Url.ToLower() == articleUrl.ToLower()); if (record == null) { return(await GetFeaturedAsync(categoryId, true)); } return(record); }
public async Task <Journal> GetAsync(int id) { var record = await Dbset.FirstOrDefaultAsync(r => r.JournalId == id); return(record); }
public async Task <ScheduledJob> GetAsync(int id) { var job = await Dbset.FirstOrDefaultAsync(r => r.JobId == id); return(job); }
public async Task <TestPlan> GetById(Guid id) { return(await Dbset.FirstOrDefaultAsync(c => c.TestPlanId == id)); }
public async Task <Line> GetById(Guid id) { return(await Dbset.FirstOrDefaultAsync(c => c.LineId == id)); }
public async Task <Model> GetById(Guid id) { return(await Dbset.FirstOrDefaultAsync(c => c.ModelId == id)); }
public async Task <IChartLayoutEntity> GetAsync(int id) { var record = await Dbset.FirstOrDefaultAsync(r => r.LayoutId == id); return(record); }
public async Task <ModelDetail> ModelGetById(Guid modelid) { return(await Dbset.FirstOrDefaultAsync(c => c.ModelId == modelid)); }
public async Task <IChartIndicatorEntity> GetAsync(int layoutId, int indicatorId) { var record = await Dbset.FirstOrDefaultAsync(r => r.PlotId == layoutId && r.IndicatorId == indicatorId); return(record); }
public async Task <Flow> GetById(Guid id) { return(await Dbset.FirstOrDefaultAsync(c => c.FlowId == id)); }
public async Task <CompanyRuleSet> GetAsync(string ticker, int ruleSetId) { var record = await Dbset.FirstOrDefaultAsync(r => r.Ticker.ToUpper() == ticker.ToUpper() && r.RuleSetId == ruleSetId); return(record); }
public async Task <ChartPlot> GetAsync(int id) { var record = await Dbset.FirstOrDefaultAsync(r => r.PlotId == id); return(record); }
public async Task <Category> GetAsync(int id) { var record = await Dbset.FirstOrDefaultAsync(r => r.CategoryId == id); return(record); }
public async Task <Station> GetById(Guid id) { return(await Dbset.FirstOrDefaultAsync(c => c.StationId == id)); }
public async Task <IndicatorIntermediateResult> GetIntermediateResultsAsync(int jobId, int indicatorId) { var record = await Dbset.FirstOrDefaultAsync(r => r.JobId == jobId && r.IndicatorId == indicatorId); return(record); }
public async Task <Strategy> GetByUrlAsync(string url) { var record = await Dbset.FirstOrDefaultAsync(r => r.Url.ToLower() == url.ToLower()); return(record); }
public async Task <ModelDetail> PartNumberGetById(Guid partnumberid) { return(await Dbset.FirstOrDefaultAsync(c => c.PartNumberId == partnumberid)); }
public async Task <StationGroup> GetByStationCode(string code) { return(await Dbset.FirstOrDefaultAsync(c => c.StationCode == code)); }
public async Task <Strategy> GetAsync(int strategyId) { var record = await Dbset.FirstOrDefaultAsync(r => r.StrategyId == strategyId); return(record); }
public async Task <Rule> GetAsync(int ruleId) { var record = await Dbset.FirstOrDefaultAsync(r => r.RuleId == ruleId); return(record); }
public async Task <Indicator> GetAsync(int id) { var record = await Dbset.FirstOrDefaultAsync(r => r.IndicatorId == id); return(record); }
public async Task <Section> GetAsync(int id) { var record = await Dbset.FirstOrDefaultAsync(r => r.SectionId == id); return(record); }
public async Task <AccountTradeEntity> GetAsync(int id) { var record = await Dbset.FirstOrDefaultAsync(r => r.AccountId == id); return(record); }
public async Task <Section> GetAsync(string sectionUrl) { var record = await Dbset.FirstOrDefaultAsync(r => r.Url.ToLower() == sectionUrl.ToLower()); return(record); }
public async Task <GlobalIndicator> GetAsync(int sectorId, int indicatorId) { var record = await Dbset.FirstOrDefaultAsync(r => r.SectorId == sectorId && r.IndicatorId == indicatorId); return(record); }
public virtual async Task <TEntity> GetAsync(int id) { return(await Dbset.FirstOrDefaultAsync(e => e.Id == id)); }