Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

ProfileService class

Version InfoThis topic applies to Episerver.ConnectForMarketingAutomation 4.0.0 and lower. For later versions, see Sample Connector - IMarketingConnector

  Interface for working with Profiles.

  • Inheritance hierarchy.
    System.Object
        DemoConnector.Services.ProfileService
  • Namespace. DemoConnector.Services
  • Assembly. DemoConnector (in DemoConnector.dll) Version: 1.0.0.0
  • C# syntax.
    public class ProfileService : IProfileService

Constructor 

Initializes a new instance of the ProfileService class.

  • NamespaceDemoConnector.Services
  • Assembly. DemoConnector (in DemoConnector.dll) Version: 1.0.0.0
  • C# syntax
public ProfileService()

Methods 

ProfileService.AddProfileToList method 

Adds the given profile to the given profile list.

  • NamespaceDemoConnector.Services
  • Assembly. DemoConnector (in DemoConnector.dll) Version: 1.0.0.0
  • C# syntax.
    public bool AddProfileToList(
      int listId,
      long profileId
    )
  • Parameters.
  • Return value. TypeBoolean
    Result of adding profile to teh given list.
  • Implements. IProfileService.AddProfileToList(Int32, Int64)

ProfileService.CreateProfile method 

Create new profile and add to a database which the profile expects.

  • NamespaceDemoConnector.Services
  • Assembly. DemoConnector (in DemoConnector.dll) Version: 1.0.0.0
  • C# syntax.
    public string CreateProfile(
      Profile newProfile
    )
  • Parameters.
    • newProfile. Type: Profile
      The new profile data.
  • Return value. TypeString
    The profile's Id string, a null if failed.
  • Implements. IProfileService.CreateProfile(Profile)

ProfileService.GetCurrentProfile method 

Go through all sources and try to get the current profile.

  • NamespaceDemoConnector.Services
  • Assembly. DemoConnector (in DemoConnector.dll) Version: 1.0.0.0
  • C# syntax.
    public Profile GetCurrentProfile()
  • Return value. Type: Profile
    The current profile.
  • Implements. IProfileService.GetCurrentProfile()

ProfileService.GetCurrentProfileFromSource method 

Get the current profile from the database ID.

  • NamespaceDemoConnector.Services
  • Assembly. DemoConnector (in DemoConnector.dll) Version: 1.0.0.0
  • C# syntax.
    public Profile GetCurrentProfileFromSource(
      int databaseId
    )
  • Parameters.
  • Return value. Type: Profile
    The current profile from the given source.
  • Implements. IProfileService.GetCurrentProfileFromSource(Int32)

ProfileService.GetProfile method 

Gets a profile by ID.

  • NamespaceDemoConnector.Services
  • Assembly. DemoConnector (in DemoConnector.dll) Version: 1.0.0.0
  • C# syntax.
    public Profile GetProfile(
      int databaseId,
      long profileId
    )
  • Parameters.
  • Return value. Type: Profile
    A profile, or null if not found.
  • Implements. IProfileService.GetProfile(Int32, Int64)

ProfileService.OptInProfile method 

Opt a profile in.

  • NamespaceDemoConnector.Services
  • Assembly. DemoConnector (in DemoConnector.dll) Version: 1.0.0.0
  • C# syntax.
    public bool OptInProfile(
      int databaseId,
      long profileId
    )
  • Parameters.
  • Return value. TypeBoolean
    True if opt in success fully, otherwise false.
  • Implements. IProfileService.OptInProfile(Int32, Int64)

ProfileService.OptOutProfile method 

Opt a profile out.

  • NamespaceDemoConnector.Services
  • Assembly. DemoConnector (in DemoConnector.dll) Version: 1.0.0.0
  • C# syntax.
    public bool OptOutProfile(
      int databaseId,
      long profileId
    )
  • Parameters.
  • Return value. TypeBoolean
    True if opt out success fully, otherwise false.
  • Implements. IProfileService.OptOutProfile(Int32, Int64)

ProfileService.RemoveProfile method 

Remove profile from the input database.

  • NamespaceDemoConnector.Services
  • Assembly. DemoConnector (in DemoConnector.dll) Version: 1.0.0.0
  • C# syntax.
    public bool RemoveProfile(
      int databaseId,
      long profileId
    )
  • Parameters.
  • Return value. TypeBoolean
    True if remove success fully, otherwise false.
  • Implements. IProfileService.RemoveProfile(Int32, Int64)

ProfileService.UpdateProfile method 

Update a profile with input fields need to update.

  • NamespaceDemoConnector.Services
  • Assembly. DemoConnector (in DemoConnector.dll) Version: 1.0.0.0
  • C# syntax.
    public bool UpdateProfile(
      int databaseId,
      long profileId,
      Dictionary<string, Object> fieldsToUpdate,
      bool addMissingColumns
    )
  • Parameters.
  • Return value. TypeBoolean
    True if update success fully, otherwise false.
  • Implements. IProfileService.UpdateProfile(Int32, Int64, Dictionary<String, Object>, Boolean)

Last updated: Dec 10, 2015