Combining properties made available via webservices profile service aspnet
Posted
by Adam
on Stack Overflow
See other posts from Stack Overflow
or by Adam
Published on 2009-09-03T02:07:01Z
Indexed on
2010/05/02
1:07 UTC
Read the original article
Hit count: 342
I really wasn't sure what the title for my question could be, so sorry if it's a bit vague.
I'm working on an application that uses client application services for authentication/profile management etc.
In web.config for my website, I have the following profile properties like this:
<properties>
<add name="FirstName" type="string" defaultValue="" customProviderData="FirstName;nvarchar"/>
...
Basic things like first name, last name etc.
I'm exposing properties for my client app like this:
<system.web.extensions>
<scripting>
<webServices>
<authenticationService enabled="true" requireSSL="false"/>
<profileService enabled="true" readAccessProperties="UserProfile" writeAccessProperties="UserProfile"/>
<roleService enabled="true"/>
</webServices>
</scripting>
</system.web.extensions>
What I'm wondering is whether it's possible to bundle all the individual profile properties into a single object for client apps to utilize? I originally had all my profile data stored as members of a single class (UserProfile) but I broke it all out so that I could use the SqlTableProfileProvider to store each field as individual columns in relevant tables.
I know I can create an class with members for each type, I'm just not sure if there's an easy way to create an object with all my property values (other than assigning values to this object whenever I assign to the the standalone properties).
I don't think I'm explaining this very well, so I'll try an example.
Say in my website profile I have FirstName and LastName as properties.
For my client application profileService I want to have one ReadAccessProperty FullName.
Is there some way to automatically create FullName from the existing FirstName and LastName properties without having to also have a seperate FullName property (and manually assign data to it whenever I assign data to FirstName and LastName)?
© Stack Overflow or respective owner