|
|
|
Forum Guru
      
Group: Forum Members
Last Login: Yesterday @ 20:21:00
Posts: 55,
Visits: 3 211
|
|
Hi All!
In Eco4 all working fine.
I am using now Eco build 5.0.0.4754 and encountered strange issues. I have a Class1 with an enum attribute (PersistenceMapper set to GenericEnumAsInteger),
My Enum: DBaseWSEnum - is defined in
namespace ModelEnums of ModelEnums.dll
I do Generate Code
(Class1.eco.cs - auto-generated):
=============Skipped=================
[UmlElement(Id="d8c5d0a0-31d2-4dff-931c-eb42cbeb7b59", Index=Eco_LoopbackIndices.Attribute5)]
[UmlTaggedValue("Eco.PMapper", "GenericEnumAsInteger")]
public DBaseWSEnum Attribute5 {
get {
return ((DBaseWSEnum)(this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Attribute5)));
}
set {
this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Attribute5, ((object)(value)));
}
}
=============Skipped=================
Result of compiling:
Error 1:
The type or namespace name 'DBaseWSEnum' could not be found (are you missing a using directive or an assembly reference?) C:\Projects\Spectr\source\Assembly\Net2\ECO5\EcoTest\EcoTest.Model\EcoTest\Class1.eco.cs 237 12 EcoTest.Model
OK!
I do: Add Reference - ModelEnums.dll (which is containing DBaseWSEnum)
and add "using ModelEnums" - то auto-generated Class1.eco.cs
Compiling - no errors.
ОК!
Then I do "Generate Code" and get the same Error 1.
I see that my text "using ModelEnums" -
has deleted from auto-generated Class1.eco.cs
I.e:
Should I add "using ModelEnums" to auto-generated Class1.eco.cs
every time after "Generate Code"?
What is wrong?
Thanks
Seg
|
|
|
|
|
Forum Guru
      
Group: Forum Members
Last Login: Yesterday @ 20:21:00
Posts: 55,
Visits: 3 211
|
|
Problem resolved! 
In Mdlr for Type of Attribute5 I use ModelEnums.DBaseWSEnum
instead of DBaseWSEnum
(i.e. namespce + "." + type)
Generate Code :
===============Skipped=================
public ModelEnums.DBaseWSEnum Attribute5 {
get {
return ((ModelEnums.DBaseWSEnum)(this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Attribute5)));
}
set {
this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Attribute5, ((object)(value)));
}
}
===============Skipped=================
All is fine!
Thanks 
Seg
|
|
|
|
|
Supreme Being
      
Group: Administrators
Last Login: 2010-11-30 12:17:13
Posts: 1 230,
Visits: 1 382
|
|
One solution is to use the full name of the type (ECO emits the type "as is" if it is not one of the known types). Another solution is to add the namespace to the packagein the property "AdditionalNamespaces". This is a comma separated list of namespaces that will be added to the using-clauses for the .eco.cs-files of all classes in the package.
/Jonas Hogstrom [CapableObjects]
|
|
|
|
|
Forum Guru
      
Group: Forum Members
Last Login: Yesterday @ 20:21:00
Posts: 55,
Visits: 3 211
|
|
Thanks, Jonas!
Is there any new news about problems of importing Eco4 -> Eco5?
I have discribed problems in 2 mails.
It stopped my work...
Thanks
Seg
|
|
|
|
|
Supreme Being
      
Group: Administrators
Last Login: 2010-11-30 12:17:13
Posts: 1 230,
Visits: 1 382
|
|
sent via email
/Jonas Hogstrom [CapableObjects]
|
|
|
|
|
Forum Guru
      
Group: Forum Members
Last Login: Yesterday @ 20:21:00
Posts: 55,
Visits: 3 211
|
|
Jonas Hogstrom (2010-04-13) sent via email
Thank You very much, Jonas!
It helped me!
Seg
|
|
|
|