I wanted to write a widget that get's the 5 most recent news items.
I have a NewsItemPart which has a date field attached from the gui called NewsStartDate.
In my code behind I wanted to query and find the 5 most recent items ordered by NewsStartDate desc..
call me a complete newbie but I really can't find clear concise documentation on how to query using the ContentManager for a given contentpart and find a value associated with it..
what it made me realise was I really haven't found anywhere which explains the basics of querying on a given part or it's associated parts.. it makes sense where in a module you have specified properties on a part.. but what about when that part and it's
property come from something you attached to make up the overall part?
i.e. something like contentManager.GetMany<NewsItem>().Where(ni => ni.SomeAttachedContentPart.SomeValue == "moo").OrderByDescending(ni => ni.SomeAttachedDatePart.DateFieldName).Take(5)
can someone give me an example please?
Thank you very much