public static List <RestaurantMenuEntity> RestaurantMenuItemList(RestaurantMenuEntity _SubCategory) { List <RestaurantMenuEntity> _ListingEntity = new List <RestaurantMenuEntity>(); using (var connection = SQLConnection.GetOpenSQLConnection()) { string sqlQuery = "RestaurantMenuItemList @id"; _ListingEntity = connection.Query <RestaurantMenuEntity>(sqlQuery, new { id = _SubCategory.id }).ToList <RestaurantMenuEntity>(); } return(_ListingEntity); }
public HttpResponseMessage ItemList(RestaurantMenuEntity _SubCategory) { HttpResponseMessage response; List <RestaurantMenuEntity> userData = new List <RestaurantMenuEntity>(); try { if (_SubCategory == null) { response = Request.CreateResponse(HttpStatusCode.PreconditionFailed, "id can not be zero or null!"); } else { userData = RestaurantMenuProcCall.RestaurantMenuItemList(_SubCategory); response = Request.CreateResponse(HttpStatusCode.OK, userData); } } catch (Exception) { response = Request.CreateResponse(HttpStatusCode.InternalServerError); } return(response); }