public async Task <JsonResult> GetSpotGoodsPatterns(SpotGoodsType type) { var manager = new SpotGoodsPatternManager(User); var result = await manager.GetSpotGoodsPatternListAsync(type); return(Json(true, string.Empty, result)); }
public async Task <IHttpActionResult> Patterns(SpotGoodsType type) { var manager = new SpotGoodsManager(); var spotGoodsPatterns = await manager.GetSpotGoodsPatternListAsync(type); var spotGoodsPatternViewModels = spotGoodsPatterns.Select(u => { return(new SpotGoodsPatternViewModel(u)); }); return(Ok(spotGoodsPatternViewModels)); }
public async Task <IEnumerable <SpotGoodsPattern> > GetSpotGoodsPatternListAsync(SpotGoodsType type) { return(await DbContext.Set <SpotGoodsPattern>().Where(r => r.Type == type).AsNoTracking().ToListAsync()); }