CSLA.net 2.0 social networking

CSLA.net 2.0 social networking

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


AKaplan posted on Tuesday, July 03, 2007

what i'm trying to develop is a social network using csla.net 2.1 framework. I just need a quick understanding of how i can add friends to a user. the structure that i have right now is a parent Object called User with a Child List object called Friends. I'm using that assign function in the childlist object but what i dont understand is what parameter should i be using to add a user as a friend. Should i be using the ApplicationContext session that was created in the MembershipProvider.ValidateUser method, or should I just be using the User.UserID? right now it's setup for the User.UserID. I just dont know if this is going to work the way it's supposed to work. I haven't gone through the debugger just yet. I'm just looking for some input on how someone would go with this

RockfordLhotka replied on Monday, July 09, 2007

You should think about your use cases.

Obviously you have several - at least these:

Each of these will have different objects to help implement the use case.

Your User object (editable root) may have a child collection of editable child UserFriend objects. Adding a friend to a user would be a matter of adding an item to that list and saving the User. Obviously there are other ways you can model this, but this model is pretty common.

If you are trying to save the data into the MembershipProvider I can't help - I haven't explored that part of ASP.NET to speak of. I think you are better off using the Profile (or UserProfile?) feature of ASP.NET 2.0, because that allows you to define your own data schema.

Copyright (c) Marimer LLC