Page 1 of 1

How to set IsUnique within Entity Developer

Posted: Mon 23 Nov 2015 15:37
by Zero-G.
Hey

I have to place an Index atribute before the property.
How can I do this within Entity Developer?
I Need:

Code: Select all

<Index("IX_FirstAndSecond", 1, IsUnique:=True)> _
Public Property Supplier as Guid
THX

Re: How to set IsUnique within Entity Developer

Posted: Tue 24 Nov 2015 11:40
by Shalex
You can add an attribute via interface of Entity Developer in the way described at http://www.devart.com/entitydeveloper/e ... eloper.chm > Basic Workflows > Code Generation > Attributes. Does this help?

Re: How to set IsUnique within Entity Developer

Posted: Tue 24 Nov 2015 12:10
by Zero-G.
Hey
THX. - I still tried this. But I can't find the IndexAttribute from within the DataAnotations.Schema Namespace.

https://msdn.microsoft.com/en-us/librar ... .113).aspx
Here a Picture, which possibilities I have to choose from

https://onedrive.live.com/embed?cid=7D6 ... 7puvX9DXCs

Please give me advice, how to do it right. - THX

Re: How to set IsUnique within Entity Developer

Posted: Tue 24 Nov 2015 16:30
by Shalex
Have you added EntityFramework.dll assembly with its attribute types via the Model Settings window > Attributes?

Re: How to set IsUnique within Entity Developer

Posted: Tue 24 Nov 2015 17:43
by Zero-G.
THX
That solved the Problem.
But for Information:
The Visual Basic Template for Self-Tracking Entity isn't working correct after adding the EntityFramework.dll for the aspects.
The reason is, that The Property EntityState is getting ambigous. And so all properties have to been set explicit to Data.EntityState.

Have a nice day!

Re: How to set IsUnique within Entity Developer

Posted: Wed 25 Nov 2015 15:24
by Shalex
Zero-G. wrote:The Visual Basic Template for Self-Tracking Entity isn't working correct after adding the EntityFramework.dll for the aspects.
The reason is, that The Property EntityState is getting ambigous. And so all properties have to been set explicit to Data.EntityState.
Please send us a small test project so that we can reproduce the issue in our environment.