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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:21:41+00:00 2026-05-12T05:21:41+00:00

I am new to setting up WCF, I have it going in my project,

  • 0

I am new to setting up WCF, I have it going in my project, but I have like 5 different ‘services’ in my one WCF project and I am wondering if I am doing the right thing. My services for now are 1-1 to my database tables. I end up having something like:

public class Projects : IProjects
{
    public List<Project> GetAll()
    {
        return (from p in Connection.Data.Projects
                select new Project {ID = p.id, Name = p.name}).ToList();
    }

    public Project GetByID(int id)
    {
        return (from p in Connection.Data.Projects
                where p.id == id
                select new Project {ID = p.id, Name = p.name}).First();
    }

    public Project AddProject(string name)
    {
        var project = new Data.Projects {name = name};
        Connection.Data.AddToProjects(project);
        Connection.Data.SaveChanges();

        return new Project {ID = project.id, Name = project.name};
    }

    public void DeleteProject(int id)
    {
        var project = (from p in Connection.Data.Projects
                       where p.id == id
                       select new Project {ID = p.id, Name = p.name}).First();

        Connection.Data.DeleteObject(project);
        Connection.Data.SaveChanges();
    }
}

I have a similar class for each of the tables in my project. Should I be finding a way to use 1 service connection with sub classes or keep it as 1 service class per table?

  • 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-12T05:21:41+00:00Added an answer on May 12, 2026 at 5:21 am

    “It depends!” 🙂 The standard answer for all IT and programming questions 🙂

    I don’t see anything wrong with having those 5 separate services – you don’t really gain anything by merging them all together into one big service, I’d say. I would prefer to keep them separate and “lean’n’mean”.

    If you have five separate services, you can also manage things like access permissions to them for each one separately, e.g. let certain user groups use one service, while not another.

    Again: I think you’re doing it just fine – I don’t see any compelling reason or benefit from having one huge services vs. five smaller, nimbler ones.

    Come to think of it – the only real change I might suggest is trying to design your services so that they are more closely matched to what your app wants to do (i.e. the operations you expect your app and thus your services to handle), rather than modelling them too closely to the database. Try to think “task-oriented” or in terms of operations, rather than the underlying store where they’ll store their data.

    Marc

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

Sidebar

Related Questions

I'm setting up a new project and have gotten NHibernate to work with structuremap...sorta.
Background I have inherited a project which relies on several different WCF "mex" endpoints
I have a solution with one WPF (4.0) project, one WCF (4.0) project, one
So I am kind of new to setting up servers. And I have been
Setting up new git installations. On one Windows laptop, I'm running (under cygwin): git
I'm starting a new project and setting up the base to work on. A
I have created one WCF service , which is working fine, now i want
Please tell me I'm doing something stupid in setting up my wcf rest service.
I have a few WCF services I am calling from a console app. I
I have a bunch of WCF services at a domain: AuthenticationService (the standard MS

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.