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 149053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:04:04+00:00 2026-05-11T09:04:04+00:00

Is there a way to ensure a particular conditional clause is added to the

  • 0

Is there a way to ensure a particular conditional clause is added to the expression tree on each select from a particular table?

For example, a table with a field with the date a record was deleted should never come back or be included in any kind of statement.

Rather than include a where clause each time, is there a way, without creating a view, to add a conditional to each select?

— Edit for clarity below —

I’m looking for a function I can partial, much like the Insert/Update/Delete functions, but for Selecting. I want to apply a blanket filter to all queries against a table.

Furthermore, if I get a collection of items from a parent, I want that set to be filtered as well.

Something like:

Private Function BaseItems() As IQueryable(Of Item)     Return (From mi In dataContext.Items Where mi.DeletedAt Is Nothing Select mi) End Function Public Function GetItems() as list(of Item)     Return (From mi in BaseItems() select mi).ToList() End Function 

works for functions I write and call. ITEMS, can be a child of MASTER, for example.

'assume TheMaster is a LinqToSQL data class which has a one to many child of Items TheMaster.Items.Count '<-- will bring back all Items. 

How do I always filter what populates by data classes?

  • 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. 2026-05-11T09:04:05+00:00Added an answer on May 11, 2026 at 9:04 am

    AssociateWith in the DataLoadOptions of the DataContext seems to do what I’m needing.

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

Sidebar

Ask A Question

Stats

  • Questions 77k
  • Answers 77k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Thanks Dan, Alright.. This answers the first question I had.… May 11, 2026 at 3:18 pm
  • added an answer If theres a way to validate the Id then theres… May 11, 2026 at 3:18 pm
  • added an answer I'm using Subsonic 2.2, I tried a few variations on… May 11, 2026 at 3:18 pm

Related Questions

I have a .net library dll that acts like a functional library. There are
I am relatively new to mod_rewrite, but have a site which I would like
Relating to my earlier question , I want to ensure all the child objects
EDIT: As of Java 8, static methods are now allowed in interfaces. Here's the

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.