Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 784707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:45:23+00:00 2026-05-14T20:45:23+00:00

I can understand what the error is saying – it can’t compare a list.

  • 0

I can understand what the error is saying – it can’t compare a list. Not a problem, other than the fact that I don’t know how to not have it compare a list when I want to page through a model with a list as a property.

My Model:

Event : IEvent
  int Id
  string Title
  // Other stuff..
  LazyList<EventDate> Dates // The "problem" property

Method which pages the data (truncated):

public JsonResult JsonEventList(int skip, int take) {

  var query = _eventService.GetEvents();

  // Do some filtering, then page data..

  query = query.Skip(skip).Take(take);

  return Json(query.ToArray());
}

As I said, the above is truncated quite a bit, leaving only the main point of the function: filter, page and return JSON’d data.

The exception occurs when I enumerate (.ToArray()). The Event object is really only used to list the common objects of all the event types (Meetings, Birthdays, etc – for example). It still implements IEvent like the other types, so I can’t just remove the LazyList<EventDate> Dates property unless I no longer implement IEvent

Anyway, is there a way to avoid this? I don’t really want to compare a LazyList when I page, but I do not know how to resolve this issue.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T20:45:23+00:00Added an answer on May 14, 2026 at 8:45 pm

    Do a transform on the data before returning it as JSON if you don’t want the list e.g.

    return Json(query.Select(event => new { event.Id, event.Title }).ToArray());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can understand that imposing a minimum length on passwords makes a lot of
Any existing Flash SWF compilers that can understand directives like #IF #ENDIF , etc?
I read the SDK document, but can not understand some details, need some help.
I can understand the use for one level of namespaces. But 3 levels of
I can understand wanting to avoid having to use a cursor due to the
As far as I can understand, when I new up a Linq to SQL
Can't understand why the following takes place: String date = 06-04-2007 07:05; SimpleDateFormat fmt
I can't understand the concept and, first of all, where it belongs. Is it
I am converting an excel sheet formula to java but I can't understand how
I'm reading some code in the Ogre3D implementation and I can't understand what a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.