Contact Me

Contact Us
For an informal discussion

Everyone's business is different. Our business is software - ask where we can help.
eMail: john at appsolo.com

Entity Framework Metadata not generated

Posted on Monday, 8th August, 2011

For those of you suffering with the half-baked n-tier solution that is Entity Framework and RIA Services, here’s a snippet of use. As you’ll know the metadata file is very necessary (so why is it optional?) but there’s no way you’re going to get the database design right first (or fiftieth) time so you’ll be regenerating a domain service lots.

This is a pain generally speaking but more of a pain given that you’ll have made modifications to both the DomainService class as well as the associated metadata classes. Now, those in the know will have created a buddy partial class for the DomainService so your custom queries will live there and be undisturbed by the creation of a new DomainService. However, I haven’t figured out a way to do the same for the metadata classes and these have a fair bit of custom attributes for things like validation. So when the metadata classes are regenerated there’s a cut-paste body of work to do.

And then there’s the interesting issue of your metadata classes not being re-generated with the DomainService even though you ticked the ‘Metadata’ box. You might have thought that excluding the old metadata file from the project would do the trick and well, it should. However, Visual Studio in its wisdom still ’sees’ these metadata classes – heck, you could probably delete them and it’ll still think they’re there. So the trick is to build the web project to flush out the offending old metadata classes and it works.

Of course, the burning question is why this kind of fudge is necessary? Surely, someone is supposed to test these things properly. It’s not like RIA Services and Entity Framework is fresh from the factory. Microsoft – if you’re listening – this is causing you to bleed developers. There’s, what, 80,000 working there? You can’t all be supporting IE6?

Comments are closed.

latest news

Running a web site hosting SL4 OOB on local host using II express

Posted on Saturday, 4th February, 2012

Free Tools available:
IIS Express free download
Visual Studio 2010 express free download (there might be a licensing issue here)
or Visual Web developer express 2010
SQL Server 2008  Express R2 free download (2010 version is available in RC0 version)
Making sure that IIS Express is installed you can develop against it
So you create your web site and client [...]

Testimonials

Excellent design skills

Posted on Sunday, 2nd May, 2010

We at Taxonomy.ie are happy to be associated with Appsolo and look forward to further work together.

follow me

twitter facebook delicious

AppsoloLtd. VAT No. IE97548691 - Copyright © 2010.