Return to Snippet

Revision: 31555
at September 8, 2010 23:41 by housecor


Initial Code
//In web.config:
		<profile inherits="Our365Insurance.Domain.ApplicantProfile, Our365Insurance.Domain" defaultProvider="Our365ProfileProvider" enabled="true" automaticSaveEnabled="false">
			<providers>
				<clear/>
				<add name="Our365ProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="AspNetConnectionString" description="Stores and retrieves profile data from the local Microsoft SQL Server database"/>
			</providers>
			<properties>
				<clear/>
				<add name="SmartNavigatorProvider" allowAnonymous="true" serializeAs="String" type="String"/>
				<add name="HighestSequenceCompleted" allowAnonymous="true" serializeAs="String" type="Int32"/>
        <add name="ApplicationID" allowAnonymous="true" serializeAs="String" type="System.Guid"/>
        <add name="IsMemberSelectedByUser" allowAnonymous="true" serializeAs="String" type="Boolean" />
			</properties>
		</profile>


//And in C# domain object:
#region Using Directives

using System;
using System.Web.Profile;
using Our365Insurance.Domain.Enums;

#endregion

namespace Our365Insurance.Domain
{
    /// <summary>
    /// This class is the custom ASP.NET Membership Profile, which provides access
    /// to the entire object model.
    /// </summary>
    [Serializable]
    public class ApplicantProfile : ProfileBase
    {
        /// <summary>
        /// Gets and sets the option for submitting/filing a request for coverage.
        /// </summary>
        [SettingsAllowAnonymous(true)]
        public FilingOption FilingOption
        {
            get
            {
                return (FilingOption)Enum.Parse(typeof(FilingOption), base.GetPropertyValue("FilingOption").ToString());
            }

            set
            {
                base.SetPropertyValue("FilingOption", value);
            }
        }

        [SettingsAllowAnonymous(true)]
        public Member Member
        {
            get
            {
                return (Member)base.GetPropertyValue("Member");
            }

            set
            {
                base.SetPropertyValue("Member", value);
            }
        }
    }
}

Initial URL


Initial Description


Initial Title
Profile example

Initial Tags
Net

Initial Language
C#