Profiles System Task and Object Mapping from COM to the .NET Framework
For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.
This topic describes how Profile objects implemented by using the Component Object Model (COM) for Commerce Server 2002 and earlier releases map to similar objects in the Commerce Server 2007 Class Library based on the .NET Framework. The scope and function of the Component Object Model (COM) Profile objects resemble that of the Profile objects available in the Commerce Server Class Library. For example, the ProfileContext type resembles a ProfileService object in COM and the Profile type resembles the COM ProfileObject type.
In the COM model for the Commerce Server Profiles system, there are three entities, all scoped to Active Server Pages (ASP) applications:
Profile service instance
OLE DB Provider for Commerce Server instance
BizDataAdmin object instance
In the .NET Framework model, the key profile service functionality is provided by the OLE DB Provider for Commerce Server and selected site term-related functionality. These are implemented in a single ProfileContext object.
Object Mapping
The .NET Framework types in the following table are in the Microsoft.CommerceServer.Runtime.Profiles namespace:
COM |
.NET Framework |
---|---|
ProfileService |
|
ProfileObject |
|
ProfileObject.Fields |
Task Mapping
The following sections contain common coding tasks and show you the COM and the .NET Framework approach to coding the solution.
Accessing the Global Profile Service Instance
COM |
.NET Framework |
---|---|
Application(MSCSProfileService) |
Creating a New Profile
COM |
.NET Framework |
---|---|
ProfileService.CreateProfile |
Retrieving an Existing Profile
COM |
.NET Framework |
---|---|
ProfileService.GetProfile |
Deleting a Profile
COM |
.NET Framework |
---|---|
ProfileService.DeleteProfile |
Setting a Profile Property Value
COM |
.NET Framework |
---|---|
profileObject.GeneralInfo.logon_<name> = <value> Where profileObject is an existing Profile object. |
profileObject[GeneralInfo.logon_name] = <name>; Where profileObject is an instance of Profile. Alternative ways:
|
Retrieving a Profile Property Value
COM |
.NET Framework |
---|---|
logonName = profileObject.GeneralInfo.logon_name Where profileObject is an existing Profile object. |
Where profileObject is an instance of Profile. Alternative ways:
|
Retrieving Immediate Profile Property Collection
COM |
.NET Framework |
---|---|
Loop through the Fields collections of the profile object and check to see whether each field is a property or a property group. For example:
|
Profile and ProfilePropertyGroup in ProfilePropertyCollection |
Retrieving Immediate Profile Property Group Collection
COM |
.NET Framework |
---|---|
Loop through Fields collections of the profile object and check to see whether the field is a property or a property group. For example:
|
Profile and ProfilePropertyGroup in ProfilePropertyGroupCollection |
Retrieving Profile Property Attributes
COM |
.NET Framework |
---|---|
Loop through the Fields collections for the profile object and check whether the field is a property or a property group. For example:
|
Retrieving Site Term Names
COM |
.NET Framework |
---|---|
Call the GetSiteTerms method of the BizDataAdmin object, and then parse the returned XML stream for the site term names. |
Retrieving Site Terms
COM |
.NET Framework |
---|---|
Call the GetSiteTerms method of the BizDataAdmin object, and then parse the returned XML stream for the site term. |
Accessing the Commerce OLE DB Provider (CSOLEDB)
COM |
.NET Framework |
---|---|
Application(MSCSAdoConnection) |
Executing Queries Through the OLE DB Provider for Commerce Server (CSOLEDB)
COM |
.NET Framework |
---|---|
Use ActiveX® Data Objects (ADO) to execute queries using the OLE DB Provider for Commerce Server (CSOLEDB). |
Use ADO.NET to execute queries by using the CSOLEDB. |