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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:28:20+00:00 2026-06-03T07:28:20+00:00

Hi I have been reading some lecture notes and I cant work out why

  • 0

Hi I have been reading some lecture notes and I cant work out why this method:

[OperationContract]
Student PostStudent (Student student);

Is good.

And this method is bad:

[OperationContract]
void PostStudent (string firstname, string lastname etc..);

Yet my implemented version is this:

[OperationContract]
void PostStudent(Student student);

So Im not sure if my implemented version is bad, Im also unsure how my lecturer got

Student PostStudent (Student student); // ?

  • 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-03T07:28:21+00:00Added an answer on June 3, 2026 at 7:28 am

    Web services are built upon the use of messages. A message in WCF is defined by writing a class, which your Student class is, and (optionally) marking it with the DataContract attribute. This enables versioning and setting various properties on the properties of that class (although the latter effect can also be achieved using the MessageParameter attribute).

    So yes, PostStudent (string firstname, string lastname etc..) is bad.

    Whether or not to return something from that method is up to you. A void can be perfectly fine, because using for example SOAP you can return a Fault indicating why the user could not be created: no error means the creation went well.

    When you want to inpect the created Student, you might as well define a PostStudentResult (or a PostResult<T>) class and return that, containing the properties Student (or T Result) and Status, where the first contains the student as it’s created and the latter indicates whether or not the creation was successful.

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

Sidebar

Related Questions

A few of us at work have been reading some on Haskell and we
I have been doing some reading and have found out that the Java Swing
I have been reading these forums for some time, but this is my first
I have been doing some reading on this subject, but I'm curious to see
I have been reading about this but I have to do some thing. I
I am a newbie on optimization. I have been reading some reference on how
As titled, how can I do that? I have been reading some Silverlight/WPF animation
I have been reading over some code lately and came across some lines such
I have been reading a lot on design patterns lately and some of them
I have been reading about Scala for a while and even wrote some small

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.