Discriminator and abstract type in new EDM designer
- After installing new EDM designer(ships with VS 2k8 Beta 1) i note one interesting thing. I try to create TPH with 1 base type and 4 derived types. Base type must be abstact and in CTP 2 when i set Abstact="True" it's works and forgot about non-used discriminator column in base type. But in new designer my abstract type throws away mapping and when i check abstract = true it doesn't use any mapping specified to this entity, i say ok let me map this properties in derived types but there are no any properties in derived types because they already mapped in base type ....
I forgot about this and trying to create TPH with base type not stored in the db and i can't do this like i do it in CTP2.
For example let's see this http://msdn.microsoft.com/en-us/library/bb738443.aspx let's assume that i don't want to store Person i want to store only Student,Instructor and Administrator Entities , i try to do this making Person abstact and delete condition from it and i have this error now:
Entity types Student, Instructor, Administrator are mapped to table Person without discriminating conditions on all mappings to the table.
But as i remember it works in CTP2.
It's only works when i return condition to mapping .... and then i have this error:
In table Person, no mapping has been specified for column Person.FirstName - this column has no default value and is not nullable.
1. And what i must do now ? Delete first name from base entity and copy paste it to derived entity , but for what then i need abstract type if i can't map shared properties between derived types ?
2. If this is a problem/bug can we hope for a hotfix in CTPx or something like this in few weeks?
I understand that this is a beta but it's strange:
create new feature in ctp 2 and broke it in beta 1 ....
Anyway i prefer new designer because i hate this bug with discriminator column value and let's just don't try to compare looks of designers
--
Sorry for my english
Answers
Well, I assume that release that you downloaded was perfectly legal, and what you ran into is a known bug in the Beta bits. You can actually safely ignore this error - your application should still work just fine.
A bit more detail: The designer, not the runtime, is the source of this error, and the bug is that designer does not detect, for this error condition, that the base type is abstract. However, since the designer does not break the build when it generates errors, this error is a misleading annoyance rather than a build breaker.
This bug is fixed in the latest internal builds.
All Replies
Can you please tell us where you downloaded the Beta1 bits from? And when?
Thanks,
Noam
I downloaded it from neighbored topic at May9 or May10 i don't remember exactly.
http://elegantcode.com/2008/05/09/visual-studio-2008-service-pack-1-beta/
As i see now link is unavailable and after a short lookout i note that beta 1 is not public ... oops
So you don't need any bug report from nonlegal user? (i mean it's not legal for me to download beta 1, but there are no any note on page that i can't download it ... :\ )
Well, I assume that release that you downloaded was perfectly legal, and what you ran into is a known bug in the Beta bits. You can actually safely ignore this error - your application should still work just fine.
A bit more detail: The designer, not the runtime, is the source of this error, and the bug is that designer does not detect, for this error condition, that the base type is abstract. However, since the designer does not break the build when it generates errors, this error is a misleading annoyance rather than a build breaker.
This bug is fixed in the latest internal builds.
Are you sure this issue is not a build breaker? I have multiple models in my project, one of which has the "Entity types ... are mapped to table Action without discriminating conditions on all mappings to the table.." error. It will build fine in the IDE, but if i try to build via a command line (devenv) i get a "Error: The operation could not be completed." If i remove the model that has the error it builds fine.
**I should specify that i am not running beta* i am running the SP1 VS 2008.


