Question

Hey, can anybody confirm the following scenario will work:

  • I am developing a 3-tier application in .NET 4.0: Winforms Client, aspx server and SQL 2008 database.
  • The server communicates with the SQL 2008 database by means of Entity Framework 4.0, and returns the entities in forms of STE's (in a separate assembly) to the client application over WCF.

Now I want to execute a stored procedure on the SQL server, which will return me a custom shaped dataformat (not a 1:1 mapping with an entity). I read that I could use complex types to hold the data this will return to me.

Now the question: will this complex type be serializable over WCF so the client can work with it too ? I suppose it is, but cannot seem to find a closing answer anywhere, and I wanna be sure before I proceed with my coding.

Thx !

TJ

Was it helpful?

Solution

Anything that can be represented in an XML Schema can be serialized and thus sent across the wire using WCF.

This includes all .NET basic primitive types like int, double, string, DateTime and any classes built from those.

Things that won't work are for instance:

  • any .NET specifics (like Exception, generics, ...) - remember, WCF is designed to be interoperable, not just between two .NET clients

  • anything with inherent behavior (like a Dictionary)

OTHER TIPS

If you return complex types to the wcf service or if you return an entity whose one of the property is of complex type, self tracking entity would have no problems. However if you are using RIA services, the complex types is not supported.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top