ProfileService Class
Namespace: PTS.Modules.Profiles.Common
Assembly: PTS.Modules.Profiles.dll
Syntax
public class ProfileService : UnitOfWorkService, IServiceProviderAccessor, IProfileService, ISeedWork<IProfileService>, ISeedWorkConstructors
ProfileService(IUnitOfWork)
Declaration
public ProfileService(IUnitOfWork unitOfWork)Parameters
| Type | Name | Description | 
|---|---|---|
| IUnitOfWork | unitOfWork | 
Properties
Contacts
Declaration
protected IRepository<Contact> Contacts { get; }Property Value
| Type | Description | 
|---|---|
| IRepository<Contact> | 
Profiles
Declaration
protected IRepository<Profile> Profiles { get; }Property Value
| Type | Description | 
|---|---|
| IRepository<Profile> | 
ProfileTypeLinks
Declaration
protected IRepository<ProfileTypeLink> ProfileTypeLinks { get; }Property Value
| Type | Description | 
|---|---|
| IRepository<ProfileTypeLink> | 
Methods
GetContact(Profile, ContactType, Boolean)
Declaration
public virtual Contact GetContact(Profile profile, ContactType type, bool primary = false)Parameters
| Type | Name | Description | 
|---|---|---|
| Profile | profile | The profile. | 
| ContactType | type | The type. | 
| System.Boolean | primary | if set to  | 
Returns
| Type | Description | 
|---|---|
| Contact | The Contact entity. | 
GetContactAsync(Profile, ContactType, Boolean)
Declaration
public virtual Task<Contact> GetContactAsync(Profile profile, ContactType type, bool primary = false)Parameters
| Type | Name | Description | 
|---|---|---|
| Profile | profile | The profile. | 
| ContactType | type | The type. | 
| System.Boolean | primary | if set to  | 
Returns
| Type | Description | 
|---|---|
| System.Threading.Tasks.Task<Contact> | A System.Threading.Tasks.Task with result of Contact entity. | 
GetContacts(Profile)
Gets the System.Collections.Generic.List<T> for Profile.
Declaration
public virtual List<Contact> GetContacts(Profile profile)Parameters
| Type | Name | Description | 
|---|---|---|
| Profile | profile | The profile. | 
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.List<Contact> | A System.Collections.Generic.List<T> which belongs to the Profile. | 
GetContactsAsync(Profile)
Gets the System.Collections.Generic.List<T> for Profile.
Declaration
public virtual Task<List<Contact>> GetContactsAsync(Profile profile)Parameters
| Type | Name | Description | 
|---|---|---|
| Profile | profile | The profile. | 
Returns
| Type | Description | 
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.List<Contact>> | A System.Threading.Tasks.Task with result of System.Collections.Generic.List<T> which belongs to the Profile. | 
GetProfileTypes(Profile)
Gets the collection of ProfileTypeLink for profile.
Declaration
public virtual List<ProfileTypeLink> GetProfileTypes(Profile profile)Parameters
| Type | Name | Description | 
|---|---|---|
| Profile | profile | The profile. | 
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.List<ProfileTypeLink> | 
GetProfileTypesAsync(Profile)
Gets the collection of ProfileTypeLink for profile.
Declaration
public virtual Task<List<ProfileTypeLink>> GetProfileTypesAsync(Profile profile)Parameters
| Type | Name | Description | 
|---|---|---|
| Profile | profile | The profile. | 
Returns
| Type | Description | 
|---|---|
| System.Threading.Tasks.Task<System.Collections.Generic.List<ProfileTypeLink>> | 
HasProfileType(Profile, Int32[])
Determines whether Profile has assigned any of the profileTypes.
Declaration
public virtual bool HasProfileType(Profile profile, params int[] profileTypes)Parameters
| Type | Name | Description | 
|---|---|---|
| Profile | profile | The profile. | 
| System.Int32[] | profileTypes | The profile types. | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | 
HasProfileTypeAsync(Profile, Int32[])
Determines whether Profile has assigned any of the profileTypes.
Declaration
public virtual Task<bool> HasProfileTypeAsync(Profile profile, params int[] profileTypes)Parameters
| Type | Name | Description | 
|---|---|---|
| Profile | profile | The profile. | 
| System.Int32[] | profileTypes | The profile types. | 
Returns
| Type | Description | 
|---|---|
| System.Threading.Tasks.Task<System.Boolean> | 
ReplaceProfileType(Profile, Int32[])
Replaces the assigned profile.
Declaration
public virtual void ReplaceProfileType(Profile profile, params int[] profileTypes)Parameters
| Type | Name | Description | 
|---|---|---|
| Profile | profile | The profile. | 
| System.Int32[] | profileTypes | The profile types. | 
ReplaceProfileTypeAsync(Profile, Int32[])
Replaces the assigned profile.
Declaration
public virtual Task ReplaceProfileTypeAsync(Profile profile, params int[] profileTypes)Parameters
| Type | Name | Description | 
|---|---|---|
| Profile | profile | The profile. | 
| System.Int32[] | profileTypes | The profile types. | 
Returns
| Type | Description | 
|---|---|
| System.Threading.Tasks.Task | 
SetContact(Profile, ContactType, String, Boolean)
Declaration
public virtual Contact SetContact(Profile profile, ContactType type, string value, bool removeIfEmpty = true)Parameters
| Type | Name | Description | 
|---|---|---|
| Profile | profile | The profile. | 
| ContactType | type | The type. | 
| System.String | value | The value. | 
| System.Boolean | removeIfEmpty | Whether to remove contact entity if provided value was empty. | 
Returns
| Type | Description | 
|---|---|
| Contact | The Contact entity. | 
SetContactAsync(Profile, ContactType, String, Boolean)
Declaration
public virtual Task<Contact> SetContactAsync(Profile profile, ContactType type, string value, bool removeIfEmpty = true)Parameters
| Type | Name | Description | 
|---|---|---|
| Profile | profile | The profile. | 
| ContactType | type | The type. | 
| System.String | value | The value. | 
| System.Boolean | removeIfEmpty | Whether to remove contact entity if provided value was empty. | 
Returns
| Type | Description | 
|---|---|
| System.Threading.Tasks.Task<Contact> | A System.Threading.Tasks.Task with result of Contact entity. | 
SetProfileType(Profile, Int32[])
Declaration
public virtual void SetProfileType(Profile profile, params int[] profileTypes)Parameters
| Type | Name | Description | 
|---|---|---|
| Profile | profile | |
| System.Int32[] | profileTypes | 
SetProfileTypeAsync(Profile, Int32[])
Declaration
public virtual Task SetProfileTypeAsync(Profile profile, params int[] profileTypes)Parameters
| Type | Name | Description | 
|---|---|---|
| Profile | profile | |
| System.Int32[] | profileTypes | 
Returns
| Type | Description | 
|---|---|
| System.Threading.Tasks.Task | 
VerifyContact(Contact, String, StringComparison)
Verifies the Contact.
Declaration
public bool VerifyContact(Contact contact, string code, StringComparison comparison = StringComparison.InvariantCultureIgnoreCase)Parameters
| Type | Name | Description | 
|---|---|---|
| Contact | contact | The contact. | 
| System.String | code | The verification code. | 
| System.StringComparison | comparison | The verification string comparison settings. | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | 
 | 
VerifyContactAsync(Contact, String, StringComparison)
Verifies the Contact.
Declaration
public virtual Task<bool> VerifyContactAsync(Contact contact, string code, StringComparison comparison = StringComparison.InvariantCultureIgnoreCase)Parameters
| Type | Name | Description | 
|---|---|---|
| Contact | contact | The contact. | 
| System.String | code | The verification code. | 
| System.StringComparison | comparison | The verification string comparison settings. | 
Returns
| Type | Description | 
|---|---|
| System.Threading.Tasks.Task<System.Boolean> | A System.Threading.Tasks.Task with result  |