public ActionResult <object> Select() { try { var test = _productsService.DoNothing(); var items = _productsService.GetAll(); if (items.ToList().Count > 0) { var toSerialize = new MessageHelpers <ProductsViewModel>() { Status = 200, Data = new List <ProductsViewModel>(items) }; return(JsonConvert.SerializeObject(toSerialize)); } else { var toSerialize = new MessageHelpers <ProductsViewModel>() { Status = 404, Data = null }; return(JsonConvert.SerializeObject(toSerialize)); } } catch { var toSerialize = new MessageHelpers <ProductsViewModel>() { Status = 502, Data = null }; return(JsonConvert.SerializeObject(toSerialize)); } }