Hello,
I'm a SubSonic 2.0 veteran now using SubSonic 3.0 with LINQ.
I need just 1 hour of help with a 3 data access calls.
See code below in the full description.
Requirements:
1. I will host a Go2Meeting, I need you to join
2. Call in or skype me
3. Talk me through what I did wrong
4. One of the lookups need to select records from the DB at random
## Deliverables
I will provide the full solution after the bid is over.
**public static IList<EventListing> FeaturedEvents(int Max)**
{
var DB = new ThisTicketComDBDB();
var qry = [login to view URL]("EventListing").OrderDesc("CreatedOn");
// TODO LIMIT TO TOP 5 RESULTS
// TODO get random events
//[login to view URL] = "5";
var events = [login to view URL]<EventListing>();
return events;
}
**public static IList<EventListing> TopEventsPerDate(DateTime SelectedDate, int Max)**
{
var DB = new ThisTicketComDBDB();
// SELECT @
// FROM [v_EventTimePerDate]
// where [StartTime] = @SelectedDate
// TO DO
// in the database there is a view: v_EventTimePerDate
var qry = [login to view URL]("EventListing").OrderDesc("CreatedOn").Where("StartTime", [login to view URL],
[login to view URL](-1));
// TODO LIMIT TO TOP (based on Max) RESULTS
// where StartTime is the same date as SelectedDate
//[login to view URL] = "5";
var events = [login to view URL]<EventListing>();
return events;
}
p**ublic static object GetDistinctListOfCategories()**
{
//TO DO REFACTOR THIS!
// only select the Category from the db, not the full record
IList<string> categories = new List<string>();
foreach (EventListing eventListing in [login to view URL]())
{
if (![login to view URL]([login to view URL]) && ![login to view URL]([login to view URL]))
[login to view URL]([login to view URL]);
}
return categories;
}