BT

New Early adopter or innovator? InfoQ has been working on some new features for you. Learn more

Enums, Entity Framework And WCF Data Services

| by Roopesh Shenoy on Sep 03, 2012. Estimated reading time: less than one minute |

Enumerations have been supported in Entity Framework 5 – however Enums are not yet supported in WCF Data Services, which means you still need to handle them explicitly when writing OData services.

EF 5 was recently released, and it included one of the most awaited features in Enum Support. However, WCF Data Services 5.0 doesn’t support Enum yet. Since WCF Data Services uses the same Entity Data Model that Entity Framework uses, if you use an EF model that includes Enums with WCF Data Services, it now leads to an arcane error.

This is a breaking change, since models with Enums in the EF model were just ignored earlier without failing. 

According to the WCF Data Services team, using NotMapped property attribute is a possible work-around. However, the NotMapped attribute prevents the property to being mapped to an underlying database column, which means we would effectively stop using the newly added Enum Support in Entity Framework as well. Support for Enums is now the most-requested feature on the WCF Data Services user forum.

WCF Data Services enables the creation and consumption of OData web services using REST semantics. 

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and dont miss out on content that matters to you

BT