public IActionResult GetLegendSpheresBySearch([FromBody] D.LegendSphere searchPrototype) { _logger.LogInformation($"Controller Method invoked: {nameof(GetLegendSpheresBySearch)}"); LegendSphere legendSphere = _mapper.Map <LegendSphere>(searchPrototype); IEnumerable <LegendSphere> model = _legendSpheresLogic.GetLegendSpheresBySearch(legendSphere); IEnumerable <D.LegendSphere> result = _mapper.Map <IEnumerable <D.LegendSphere> >(model); return(new ObjectResult(result)); }
public IEnumerable <LegendSphere> GetLegendSpheresBySearch(LegendSphere searchPrototype) { _logger.LogInformation($"Logic Method invoked: {nameof(GetLegendSpheresBySearch)}"); //ignore: all but Realm and Character var query = _enlirRepository.GetMergeResultsContainer().LegendSpheres; if (searchPrototype.Realm != 0) { query = query.Where(l => l.Realm == searchPrototype.Realm); } if (searchPrototype.CharacterId != 0) { query = query.Where(l => l.CharacterId == searchPrototype.CharacterId); } return(query); }