public static List <usp_GetLatestPrivateMessages_Result> GetLatestPrivateMessages(string userId, int pageIndex, int pageCount) { try { using (SmacEntities context = new SmacEntities()) { var msgs = context.usp_GetLatestPrivateMessages(userId).ToList(); return(msgs); } } catch (Exception ex) { throw ex; } }