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.