public static ResponseViewModel <List <GetCustomerById_Result> > GetCustomersById(int id) { using (EcommerceEntities entities = new EcommerceEntities()) { ResponseViewModel <List <GetCustomerById_Result> > response = new ResponseViewModel <List <GetCustomerById_Result> >(); List <GetCustomerById_Result> result = entities.GetCustomerById(id).ToList(); response.Data = result; return(response); } }