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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:39:00+00:00 2026-06-02T02:39:00+00:00

I have a vs2010 solution with many project (WPF control library, some business logic

  • 0

I have a vs2010 solution with many project (WPF control library, some business logic etc.)
Currently each library reach the WCF data services using his own Service Reference.
I’m trying to write a new library that will a some kind of a DL to the WCF data service, I want to write it using templates – so I don’t need to write the same function to all my entities (~30).
Well I’m getting nowhere..

I started by add a simple Interface like this:

public interface IRepository<T>
{
    IQueryable<T> GetAll();
    T GetSingle(int id);
    IQueryable<T> FindBy(Expression<Func<T, bool>> predicate);
    IQueryable<T> Where(Expression<Func<T, bool>> predicate);
    void Add(T entity);
    void Delete(T entity);
    void Update(T entity);        
}

I’m trying to implement the interface and I came into issues I have no Idea how to solve

1) in the implementing class how do I tell my context which entity I’m querying

public IQueryable<Region> Where(Expression<Func<T, bool>> predicate)
{   
    return _context.(something general).Where(predicate);
}

2) Even if I provide the entity

public IQueryable<Region> Where(Expression<Func<T, bool>> predicate)
{   
    return _context.Region.Where(predicate);
}

I came into casting issues I didn’t manage to solve.

well, that’s about it.
Thank you

  • 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-02T02:39:01+00:00Added an answer on June 2, 2026 at 2:39 am

    I’ve been experiencing by the very same problem: it is not possible to declare a WCF contract with open generic types (nor interfaces, by the way). The problem is that this framework does not adhere to some basic good OOP principles and, thus, it causes some frustration to experienced programmers.

    For more information about this issue, see the example at msdn.

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

Sidebar

Related Questions

I have a solution in VS2010 with several projects, each making up a layer
I have VS2010 and solution with many projects, I want to add MSBuild script
I have a VS2010 (RTM) solution which contains: WCF Service project Console WCF client
I have a database project in my VS2010 solution. I recently changed a view
I have a database project in my vs2010 solution. The working database is installed
I have a web application solution VS2010 where I output to ..\..\Project.Namespace.Bin\ When I
I have a solution in VS2010 with 3 projects: WCFServiceLib - a project created
I have a few different solution configurations in my VS2010 solution. For some of
I have a solution in C:\full path here\VS2010\blender.sln This solution contains many projects(around 100).
I have a VS2010 solution that has two projects. The first project [DevLib] is

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.