gives user record in contact list

vnext
Paul Schneider 8 years ago
parent b75c5c7839
commit cdad8a558f
1 changed files with 2 additions and 1 deletions

@ -8,6 +8,7 @@ using Yavsc.Models;
using Microsoft.AspNet.Identity; using Microsoft.AspNet.Identity;
using System.Linq; using System.Linq;
using System.Security.Claims; using System.Security.Claims;
using Microsoft.Data.Entity;
namespace Yavsc.Controllers namespace Yavsc.Controllers
{ {
@ -53,7 +54,7 @@ namespace Yavsc.Controllers
if (User.Identity.IsAuthenticated) { if (User.Identity.IsAuthenticated) {
ViewBag.IsAuthenticated=true; ViewBag.IsAuthenticated=true;
string uid = User.GetUserId(); string uid = User.GetUserId();
ViewBag.Contacts = DbContext.Contacts.Where(c=>c.OwnerId == uid) ViewBag.Contacts = DbContext.Contacts.Include(c=>c.User).Where(c=>c.OwnerId == uid)
; ;
} else ViewBag.IsAuthenticated=false; } else ViewBag.IsAuthenticated=false;
return View(); return View();

Loading…