1

Hi im working on a Article page and have a model for articles that takes a ApplicatonUser Property..

    public class postModels
    {
        public int ID { get; set; }
        public postModels parentPost { get; set; }

        [StringLength(255)]
        [Required]
        public string title { get; set; }
        public string post { get; set; }

        public ApplicationUser appUser { get; set; }
        public DateTime created { get; set; }
        public DateTime lastEdited{ get; set; }
    }

in my Razor View i Try this

@foreach (var item in Model)
<div class="row">
    <div class="col-md-2">

        @Html.DisplayFor(modelItem => item.created)
        <br />
        @Html.DisplayFor(modelItem => item.lastEdited)
        <br />
        @Html.DisplayFor(ModelItem => item.appUser.NickName)


        <br />
        <br />
        <br />
        <br />
        @Html.ActionLink("Edit", "Edit", new { id = item.ID }) |
        @Html.ActionLink("Details", "Details", new { id = item.ID }) |
        @Html.ActionLink("Delete", "Delete", new { id = item.ID })

    </div>
    <div class="col-md-10">
        <div class="row">
        <div class="col-md-12"><h1>@Html.DisplayFor(modelItem => item.title)</h1></div>
        <div class="col-md-12">@Html.DisplayFor(modelItem => item.post)</div></div>
    </div>
</div>

The output for everything except the ApplicationUer property works.. Thanks for the help and interest :)

0 Answers0