Esempio n. 1
0
        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);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 6
0
        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);
        }
Esempio n. 8
0
 public async Task <TestPlan> GetById(Guid id)
 {
     return(await Dbset.FirstOrDefaultAsync(c => c.TestPlanId == id));
 }
Esempio n. 9
0
 public async Task <Line> GetById(Guid id)
 {
     return(await Dbset.FirstOrDefaultAsync(c => c.LineId == id));
 }
Esempio n. 10
0
 public async Task <Model> GetById(Guid id)
 {
     return(await Dbset.FirstOrDefaultAsync(c => c.ModelId == id));
 }
Esempio n. 11
0
        public async Task <IChartLayoutEntity> GetAsync(int id)
        {
            var record = await Dbset.FirstOrDefaultAsync(r => r.LayoutId == id);

            return(record);
        }
Esempio n. 12
0
 public async Task <ModelDetail> ModelGetById(Guid modelid)
 {
     return(await Dbset.FirstOrDefaultAsync(c => c.ModelId == modelid));
 }
Esempio n. 13
0
        public async Task <IChartIndicatorEntity> GetAsync(int layoutId, int indicatorId)
        {
            var record = await Dbset.FirstOrDefaultAsync(r => r.PlotId == layoutId && r.IndicatorId == indicatorId);

            return(record);
        }
Esempio n. 14
0
 public async Task <Flow> GetById(Guid id)
 {
     return(await Dbset.FirstOrDefaultAsync(c => c.FlowId == id));
 }
Esempio n. 15
0
        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);
        }
Esempio n. 16
0
        public async Task <ChartPlot> GetAsync(int id)
        {
            var record = await Dbset.FirstOrDefaultAsync(r => r.PlotId == id);

            return(record);
        }
Esempio n. 17
0
        public async Task <Category> GetAsync(int id)
        {
            var record = await Dbset.FirstOrDefaultAsync(r => r.CategoryId == id);

            return(record);
        }
Esempio n. 18
0
 public async Task <Station> GetById(Guid id)
 {
     return(await Dbset.FirstOrDefaultAsync(c => c.StationId == id));
 }
Esempio n. 19
0
        public async Task <IndicatorIntermediateResult> GetIntermediateResultsAsync(int jobId, int indicatorId)
        {
            var record = await Dbset.FirstOrDefaultAsync(r => r.JobId == jobId && r.IndicatorId == indicatorId);

            return(record);
        }
Esempio n. 20
0
        public async Task <Strategy> GetByUrlAsync(string url)
        {
            var record = await Dbset.FirstOrDefaultAsync(r => r.Url.ToLower() == url.ToLower());

            return(record);
        }
Esempio n. 21
0
 public async Task <ModelDetail> PartNumberGetById(Guid partnumberid)
 {
     return(await Dbset.FirstOrDefaultAsync(c => c.PartNumberId == partnumberid));
 }
Esempio n. 22
0
 public async Task <StationGroup> GetByStationCode(string code)
 {
     return(await Dbset.FirstOrDefaultAsync(c => c.StationCode == code));
 }
Esempio n. 23
0
        public async Task <Strategy> GetAsync(int strategyId)
        {
            var record = await Dbset.FirstOrDefaultAsync(r => r.StrategyId == strategyId);

            return(record);
        }
Esempio n. 24
0
        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);
        }
Esempio n. 26
0
        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);
        }
Esempio n. 28
0
        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);
        }
Esempio n. 30
0
 public virtual async Task <TEntity> GetAsync(int id)
 {
     return(await Dbset.FirstOrDefaultAsync(e => e.Id == id));
 }