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

  • SEARCH
  • Home
  • 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 7539083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:17:24+00:00 2026-05-30T07:17:24+00:00

I have a class BaseEvent and it have the following fields: Name, RecurrenceStart, RecurrenceEnd,

  • 0

I have a class BaseEvent and it have the following fields:

Name, RecurrenceStart, RecurrenceEnd, SimillarId

For example we have a data in a table:

Name           RecurrenceStart                RecurrenceEnd          SimillarId 
Event1      2012-02-21 09:00:00.000      2012-02-28 11:30:00.000        1
Event1      2012-02-21 04:30:00.000      2012-02-28 07:00:00.000        1
Event2      2012-02-21 06:30:00.000      2012-02-29 09:00:00.000        2

And we have the following query:

   var today = DateTime.Now;
    return  Database.BaseEvents.Where(e => e.RecurrenceStart.Value.Date <= today 
             && e.RecurrenceEnd.Value.Date >= today).ToList();

The query return all 3 records(for current date). But the first two record is the same event.
I want that in the result will only two records: 3 and (1 or 2).
How can I do this?
Thanks.

P.S. I was introduce SimillarId for this purpose, but I don’t know how to build a query with it or not.

P.S.2. Change question name if it necessery.

  • 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-30T07:17:25+00:00Added an answer on May 30, 2026 at 7:17 am

    Use .Distinct() with an IEqualityComparer<BaseEvent> as argument which you have to implement first.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have class with 5 fields. public class Test { public string name; public
I have a base class called BaseEvent . And, 3 classes derived from BaseEvent
I have class B and class A. In method of class B (let name
I have class Cab(models.Model): name = models.CharField( max_length=20 ) descr = models.CharField( max_length=2000 )
I have class Myadapter extends BaseAdapter.in Myadapter i changed the MyListView data then call
I have class Person { @OneToMany(cascade = CascadeType.ALL) @JoinTable(name = person_countries, joinColumns = {
I have a base class called BaseEvent and several descendants classes: public class BaseEvent
I have Class and Student objects. Both have collection of another as property. Which
I have class LegacyClass which inherits OldBaseClass. I'm considering a change to introduce a
I have class that extend FragmentActivity in it I add fragment to layout as

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.