Property being overwrote when calling Fetch method?

Property being overwrote when calling Fetch method?

Old forum URL: forums.lhotka.net/forums/t/2404.aspx


Nemisis posted on Thursday, February 22, 2007

Hi everyone,
Hope you are all doing ok?

I have a little problem.  I have created a method in my Principal object, as follows:

Public Function Authorize() As Boolean
Dim identity As UserIdentity = DirectCast(Me.Identity, UserIdentity)
identity.GetAuthorization()
If identity.IsAuthorized
Then
Dim principal As New UserPrincipal(identity)
Csla.ApplicationContext.User = principal
End
If
Return identity.IsAuthorized
End
Function

The factory method 'GetAuthorization' which is apart of the identity object, is as follows:

Friend Sub GetAuthorization()
DataPortal.Fetch(Of UserIdentity)(New AuthorizationCriteria(99))
End Sub

Hopefully this all looks ok.  Now in the Identity object i have added an extra property called IsAuthorized, and my value is being updated to True in the fetch method code, but when it checks the identity.IsAuthorized property, it is for some reason set to False.

Is the object being recreated or something?  In order to get the principal object in the first place i am using Csla.ApplicationContext.User.Principal.

I am using version 2.1.3 which i downloaded the other day.

Thanks in advanced

Nemisis replied on Thursday, February 22, 2007

I am sorry everyone for wasting your time, i have figured it out now.  I am fairly new to Csla.

Thanks

Copyright (c) Marimer LLC