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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:13:53+00:00 2026-06-05T11:13:53+00:00

I am playing around with WCF 4.0. I have a simple service with the

  • 0

I am playing around with WCF 4.0. I have a simple service with the following as DataContract:

[DataContract]
public class WeeklySchedule
{
    [DataMember]
    public DateTime DateMon;
    [DataMember]
    public string DishMon;
    [DataMember]
    public DateTime DateTue;
    [DataMember]
    public string DishTue;
    [DataMember]
    public DateTime DateWed;
    [DataMember]
    public string DishWed;
    [DataMember]
    public DateTime DateThu;
    [DataMember]
    public string DishThu;
    [DataMember]
    public DateTime DateFri;
    [DataMember]
    public string DishFri;
}

I want to build a separate class library to hold the database access methods. I want these methods to return the WeeklySchedule objects.

How can i do this avoiding circular reference?

If i reference the DAL class to the WCF service i can use the db methodss, but the DAL class cannot “see” the DataContract class.

  • 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-05T11:13:55+00:00Added an answer on June 5, 2026 at 11:13 am

    We added a third ‘layer’ which we call application. It has access to the DTO (your class defined in your question) and the data layer. The application layer then acts as the one that has a view of everything. It gets the data from the data layer and has the job of populating the data contract prior to returning it to the caller. So it will do a bulk of your service work.

    This avoids your circular reference. 🙂

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

Sidebar

Related Questions

I'm playing around with WCF Data Services (ADO.NET Data Services). I have an entity
I've been playing around with WCF in conjunction with EF and have ran into
I'm playing around with a WCF service. The problem I'm having is that VS2010
Playing around in order to learn XSLT, I have the following XML file and
I've been playing around with creating a REST based WCF service sending and receiving
Just playing around with entity framework. Now I have a simple database, containing to
I'm playing around with Castle WCF integration facility because I want to integrate my
Was playing around a little bit with the TimeSpan class and I started wondering
I've been playing around lately with Entity Framework, WCF RIA Services, and Silverlight 4.
Playing around with a custom built CMS and I have an issue where I

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.