'ORM' is not a member of 'String'.

Posts   
 
    
Dan1
User
Posts: 41
Joined: 20-Sep-2007
# Posted on: 08-Nov-2007 20:37:16   

v2.5 I am getting this error in a generated SS entity class. Here is the code that causes the error:

Weld.ORM is the project/namespace name that's why it is using this here. However Weld is also a string property in the entity so that's why there is a conflict.

    ''' <summary>Returns the EntityType Enum value For this entity.</summary>
    <Browsable(False), XmlIgnore> _
    Public Overrides ReadOnly Property LLBLGenProEntityTypeValue As Integer
        Get 
            Return CInt(Weld.ORM.EntityType.WeldImages_Spot_WeldsEntity)
        End Get
    End Property


    ''' <summary>The Weld property of the Entity WeldImages_Spot_Welds<br/><br/>
    ''' </summary>
    ''' <remarks>
    ''' Mapped on table field: "tblWeldImages_Spot_Welds"."Weld"<br/>
    ''' Table field type characteristics (type, precision, scale, length): NVarChar, 0, 0, 50<br/>
    ''' Table field behavior characteristics (is nullable, is PK, is identity): True, False, False
    ''' </remarks>
    Public Overridable Property [Weld]() As System.String
        Get
            Return CType(GetValue(CInt(WeldImages_Spot_WeldsFieldIndex.Weld), True), System.String)
        End Get
        Set
            SetValue(CInt(WeldImages_Spot_WeldsFieldIndex.Weld), value, True)
        End Set
    End Property
Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 09-Nov-2007 10:45:04   

This will cause ambiguity, you should change either of them.

Dan1
User
Posts: 41
Joined: 20-Sep-2007
# Posted on: 09-Nov-2007 14:12:25   

Is there a possibility that this will this be resolved in a future update of the software?

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 09-Nov-2007 14:22:28   

This has nothing to do with LLBLGen Pro.

If you have a NameSpace that's Weld.ORM and then you define a variable with the name Weld.

In the same scope of the defined variable, if you use the namespace to fully qualify an object, like Weld.XYZ.ABC how the compiler will diffrentiate between the Weld string variable and the Weld in the namespace.

And if it has to pick one of them it will pick the closest in the scope which will be the string variable, and hence the error because the string type doesn't have a property called ORM.

You can repro this using a simple V.S project. And see if it's going to compile.

If I'm missing out any detail or solution, please suggest to us what we can do to solve this issue.