コード例 #1
0
        public ActionResult StartSessionLog()
        {
            //use session id to get sender id and recipient id
            var session   = Request["session"];
            var sender    = int.Parse(Request["sender"]);
            var recipient = int.Parse(Request["recipient"]);

            //create session record in the db
            SessionService.BeginSessionLog(sender, recipient, session);
            List <Contact> contactList;

            try
            {
                contactList = ContactService.GetContactList(recipient, db).ToList();
            }
            catch (Exception eIndexContactList)
            {
                return(View("Error", new HandleErrorInfo(eIndexContactList, "Call", "Index")));
            }

            var profileList = new List <Profile>();

            profileList.AddRange(
                contactList.Select(contact => db.Profiles.FirstOrDefault(prof => prof.CppUserId == contact.ContactListMemberId)));

            return(View("Index", profileList));
        }