Ejemplo n.º 1
0
        public JsonResult GetProducers(string text)
        {
            var producers = _producerRepository.GetAllQueryable().Select(x => new ProducerViewModel
            {
                Name  = x.Name,
                RowId = x.RowId
            });

            if (!string.IsNullOrEmpty(text))
            {
                producers = producers.Where(x => x.Name.Contains(text));
            }

            return(Json(producers, JsonRequestBehavior.AllowGet));
        }