WCF: Why to use System.ServiceModel.Channels.Message class?
WCF and WF
1
Posts
1
Posters
1
Views
1
Watching
-
I have a general question. Why sometimes should we use System.ServiceModel.Channels.Message class instead of some concrete class when we create WCF service? For example: 1) We can use the following:
public Person GetPersonById(int id)
{
Person person = Employees.CreateEmployees().First(e => e.Id == id);
return person;
}- But we can use the following as well:
public Message GetPersonById(Message id)
{
string firstName = Employees.CreateEmployees().First(e => e.Id == id.GetBody()).FirstName;
Message response = Message.CreateMessage(id.Version, ReplyAction, firstName);
return response;
}What's the difference? Thank you in advance. Goran