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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:47:04+00:00 2026-06-09T23:47:04+00:00

i think this is the first time i’ve not been able to find the

  • 0

i think this is the first time i’ve not been able to find the answer to my question just by searching.

I’m doing some prototypes for a remake of our company system and i hit upon a problem i can’t seem to get my head around.

I’m trying to utilise a reasonably generic DAO coupled dependency injection.
The problem i’m having is that i’d like to use a third party library for query definition within the method of the interface.

An example

public interface TestDAO<TEntity>
{
    /// <summary>
    /// get ALL the things
    /// </summary>
    /// <returns></returns>
    IEnumerable<TEntity> GetAll();

    /// <summary>
    /// Runs a supplied "where" clause and returns ALL the matched results
    /// </summary>
    IEnumerable<TEntity> FindAll(Specification<TEntity> specification);
}

Specification in this case is an object from a third party library called LinqSpecs.

It is my understanding that by doing this i’m essentially forcing a dependency on the third-party library on any implementation of the interface.

I understand that I can just forego using the library but if possible i’d like to keep it, at least until we’ve assessed its usefulness.

My question is, is there a way of doing this(or something similar) without dragging the third party dependency with it.

Thanks in advance.

  • 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-06-09T23:47:05+00:00Added an answer on June 9, 2026 at 11:47 pm

    You actitually want to give your interface TestDAO a searchfilter that can be hidden behind your own interface

        public interface TestDAO<TEntity>
        {
            IEnumerable<TEntity> FindAll(ISearchFilter<TEntity> specification);
        }
    
        public interface ISearchFilter<TEntity>
        {
        }
    

    The searchfilter implementation contains the actual data

        public class LinqSpecsSearchFilter : ISearchFilter<TEntity>
        {
            Specification<TEntity> specification;
        }
    

    The downside of this aproach is that
    your TestDAO implementation must do some ugly casting to get the LinqSpecs.Specification

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

Sidebar

Related Questions

I'm working with Doctrine2 for the first time, but I think this question is
This is my first time trying Pandas. I think I have a reasonable use
I'm building a SpringMVC project for the first time and just wanted some feedback
Okay at first I thought this would be pretty straightforward. But I can't think
$('#servertable td:eq(' + server + ')') this finds only 1 (first I think) match,
I'm going a little mad I think. This is the VERY first thing I
I was just reading this line: The first thing the format() method does is
First, thank you for reading this. I am just starting php and I am
I think this could be a very easy question for you. But I have
when I access any page of my ASP.NET MVC website first time, then this

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.