Is there any official recommendation on using structs as return types with WCF services?
I'm currently interacting with a service I did not write and find myself inspired to ask to see if my annoyance is warranted.
I've in past always used classes - probably in part because that's what samples always show but as I think about it now, for other "intuitive" reasons:
I started contract style by defining a separate project with interfaces representing the types that would be passed back and forth by the service.
I use LINQ a lot, so tests for nullability are implicit with reference types whereas with structs and other value types I'd always need to mark nullable.
Those are some that come to me right away although I'll admit it's more intuitive than a bulleted list in my mind. I thought to ask the question because I'm dealing with a service that returns structs and having to write when dealing with return values:
var foo = Bar.Value.MyField;
instead of
var foo = Bar.Value;