Hi,
I've inherited an app that's written in 1.x and I am part-way through upgrading it to 2.x,
I've come across the use of: BusinessPrincipal.Login()
I'm not sure how to upgrade this method and can't see something that directly replaces it.
What's the best way of upgrading this and how much work does this feel like?
Thanks.
Craig
PS. Great Book!
I should probably add into the thread, that the application has alrady been deployed for a few years and now has had users registered on it, so it's not a new-build application.
What I need to a way to upgrade that preserves these users signin information such that the new version is is as transparent to the users as it can be.
I'm not really sure how BusinessPrincipal.Login works in 1.x. (Does it provide a usernmame / password system?? )
Thanks
Craig
Hi,
In CSLA 1.x in a class named MyUser (copied from BusinessPrincipal, not inherited) you would have a Login method like this:
Public Shared Sub Login(ByVal Username As String, ByVal Password As String)The constuctor of the class includes code like this:
Private Sub New(ByVal Username As String, ByVal Password As String)===========================================================
In CSLA 2.x it looks more like this:
<Serializable()> _
Public
Shared Function Login(ByVal username As String, ByVal password As String) As BooleanJoe
Thanks Joe.
I've got the app to compile and allow me to login.
Basically I did the following:
Lift Security.PTPrincipal and Security.PTIdentity from the project tracker example and re-name and namespace them to suit.
Change references in my Login class [MyUser] to BusinessPrincipal.Login(user, password, connection string) to Security.PTPrincipal(user, password)
Updated the connection string used by PTPrincipal to use my connection string.
I guess I've not changed anything by ideology, but hopefully the custom?? lockout logic will still work as before.
The class I have here 'login.cs' (inherited from BusinessBase) seems to have quite a bit of aditional code and would probably take quite a bit of thought to refactor, so I'll leave it at that for now!
Craig
Copyright (c) Marimer LLC