Page 1 of 1

How to specify 1 to 0...1 mapping in abstract classes?

Posted: Tue 05 Jul 2011 07:29
by geddar
Hi, DEVART team!
I've got some problems with my mapping schema:

http://dostavka-61.ru/img/db_schema.jpg
Now I need to associate 1 Message with 0...1 Attachment, but every time I try to specify mapping, I got an error.

Full project is here: http://dostavka-61.ru/img/MailManager.zip
Can anyone help me?

Posted: Wed 06 Jul 2011 10:58
by AndreyR
You should have specified the Referential Constraint Properties for the Message_Attachment association.
I have sent the modified model to the e-mail address you provided in your forum profile.

Posted: Thu 07 Jul 2011 07:44
by geddar
AndreyR wrote:You should have specified the Referential Constraint Properties for the Message_Attachment association.
I have sent the modified model to the e-mail address you provided in your forum profile.
Thanks very much! This helps me, but I've got another problem:
I've included my files "MailManager.Diagram1.view", "MailManager.edml", "MailManager.edps" in my VS 2010 project. Then, after build, I've got an exception:
"Mapping and metadata information could not be found for EntityType 'Agro2010Model.Message'.
In 'Model Settings' I've chosen "EmbedInOutputAssembly" artifact processing.
When I tried to change it to "CopyToOutputDirectory", I've got the same result. In both cases, generated files are in the "obj/debug" directories. Generated connection string is @"metadata=res://*/MailManager.csdl... I've tried to change it in many ways, but all my attempts were wasted.
What's wrong?

Cпасибо! Это мне помогло, но появилась другая проблема:
Я включил файлы "MailManager.Diagram1.view", "MailManager.edml", "MailManager.edps" в проект. Билдится без ошибок, но при запуске вылетает исключение:
"Mapping and metadata information could not be found for EntityType 'Agro2010Model.Message'"
В настройках модели я выставлял оба способа включения метаданных, но это мне не помогло, хотя что xml-схемы, что библиотека, создаются и помещаются в "obj/debug". EntityDeveloper генерит строку содинения @"metadata=res://*/MailManager.csdl... И я прописывал все варианты вплоть до указания абсолютного пути до файлов, но всё тщетно.
Что не так? Заранее спасибо!

Posted: Mon 11 Jul 2011 00:47
by geddar
UP

Posted: Mon 11 Jul 2011 14:19
by AndreyR
Thank you for the additional information, I have reproduced the issue.
We will let you know about the results of our investigation.