[BUG] Extended Properties access in T4 (v4.1.41)

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
r.heuschkel@ibitech.com
Posts: 14
Joined: Mon 22 Aug 2011 15:44

[BUG] Extended Properties access in T4 (v4.1.41)

Post by r.heuschkel@ibitech.com » Tue 13 Sep 2011 15:46

I defined an Extended Property for classes in the model designer named "GenerateInterface".
But when I try to access it in my modified ObjectContext T4 template with

Code: Select all

cls.GetProperty("GenerateInterface");
I get the following error: "Custom tool error: Unknown property 'GenerateInterface'."

Using

Code: Select all

cls.GetExtendedProperties().FindProperty("GenerateInterface");
or

Code: Select all

cls.GetExtendedProperties().GetProperty("GenerateInterface");
results in the same error or a null reference.

But querying the collection with

Code: Select all

cls.GetExtendedProperties().FirstOrDefault(x => x.Name == "GenerateInterface")
as a workaround or enumerating through all Extended Properties of my class, I get/see my Extended Property. So I guess there is something wrong with the FindProperty() method.

Shalex
Devart Team
Posts: 8036
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Wed 14 Sep 2011 12:28

The developer can customize the set of properties of any element in the model by declaring extended properties in two ways:
a) in template code like: b) in model properties: right click on diagram surface > Edit Model Settings > Model > Extended Properties, then choose the element you are interested in and add an extended property.

Have you defined your extended property in the template or in the model? If the problem persists, please send us your template or model correspondingly.

r.heuschkel@ibitech.com
Posts: 14
Joined: Mon 22 Aug 2011 15:44

Post by r.heuschkel@ibitech.com » Wed 14 Sep 2011 15:23

I defined it in the model properties, but I also tried it in the template code like it is shown in your help files. Both had the same result.

I sent you my model via the formular with a reference to this and the other bug it just reported.

Shalex
Devart Team
Posts: 8036
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Mon 19 Sep 2011 16:49

r.heuschkel@ibitech.com wrote:I defined an Extended Property for classes in the model designer named "GenerateInterface".
But when I try to access it in my modified ObjectContext T4 template with
Code:
cls.GetProperty("GenerateInterface");
I get the following error: "Custom tool error: Unknown property 'GenerateInterface'."
Could you please specify the exact steps we should follow with your model using Entity Developer v 4.1.41 to reproduce "Custom tool error: Unknown property 'GenerateInterface'."? Where exactly in your template should we place the mentioned line of code?

r.heuschkel@ibitech.com
Posts: 14
Joined: Mon 22 Aug 2011 15:44

Post by r.heuschkel@ibitech.com » Wed 21 Sep 2011 07:48

Shalex wrote:
r.heuschkel@ibitech.com wrote:I defined an Extended Property for classes in the model designer named "GenerateInterface".
But when I try to access it in my modified ObjectContext T4 template with
Code:
cls.GetProperty("GenerateInterface");
I get the following error: "Custom tool error: Unknown property 'GenerateInterface'."
Could you please specify the exact steps we should follow with your model using Entity Developer v 4.1.41 to reproduce "Custom tool error: Unknown property 'GenerateInterface'."? Where exactly in your template should we place the mentioned line of code?
Everywhere where you can find my workaround code "GetExtendedProperties().FirstOrDefault".

Shalex
Devart Team
Posts: 8036
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Thu 22 Sep 2011 15:50

We cannot reproduce the problem at the moment. Please specify the regional settings of your workstation: Control Panel > Reginal and Language Options > the "Standards and formats" drop-down value, Location, and Language for non-Unicode programs.

r.heuschkel@ibitech.com
Posts: 14
Joined: Mon 22 Aug 2011 15:44

Post by r.heuschkel@ibitech.com » Thu 22 Sep 2011 16:07

Shalex wrote:We cannot reproduce the problem at the moment. Please specify the regional settings of your workstation: Control Panel > Reginal and Language Options > the "Standards and formats" drop-down value, Location, and Language for non-Unicode programs.
Everything is set to de-CH (German, Switzerland).

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Wed 28 Sep 2011 13:46

Sorry for the delay. We couldn't reproduce the issue in our environment.

A possible cause of the problem is that a national character similar to a standard Latin symbol was accidentally used in the "GenerateInterface" constant. Please ensure that this is not the case.

Also, we've made some changes that may be related to this issue. If the problem persists, please try the new build when it is available (we plan to release it in several days) and tell us if the issue can be reproduced with it.

r.heuschkel@ibitech.com
Posts: 14
Joined: Mon 22 Aug 2011 15:44

Post by r.heuschkel@ibitech.com » Mon 03 Oct 2011 13:19

StanislavK wrote:Sorry for the delay. We couldn't reproduce the issue in our environment.

A possible cause of the problem is that a national character similar to a standard Latin symbol was accidentally used in the "GenerateInterface" constant. Please ensure that this is not the case.

Also, we've made some changes that may be related to this issue. If the problem persists, please try the new build when it is available (we plan to release it in several days) and tell us if the issue can be reproduced with it.
The string is purely made out of ASCII 7 bit chars. But whatever, the new version fixed the problem for me.

Post Reply