Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

New Post: DataRefrence Data In Razor

$
0
0
The C1 Data layer will return "a flat structure" consisting of simple fields (string, int, guid etc) and not an object structure.

You need to do join with the Airline type, something like this:
var myList = from tour in Data.Get<Countries.Tour>()
join airline in Data.Get<Countries.Airline>() on tour.Airline equals airline.Id
select new { airline.Name, tour.Thumb};

@foreach (var element in myList)
{
     @element.Name 
    <img src='~/media(@element.Thumb)'  />
}
See http://stackoverflow.com/questions/37324/what-is-the-syntax-for-an-inner-join-in-linq-to-sql

Viewing all articles
Browse latest Browse all 2540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>