Пример #1
0
        /// <summary>
        /// Serves as a hash function for a particular type.
        /// </summary>
        /// <returns>
        /// A hash code for the current <see cref="T:System.Object"/>.
        /// </returns>
        /// <filterpriority>2</filterpriority>
        public override int GetHashCode()
        {
            unchecked
            {
                int result = AgencyType != null?AgencyType.GetHashCode() : 0;

                result = (result * 397) ^ (AgencyName != null ? AgencyName.GetHashCode() : 0);
                result = (result * 397) ^ (EffectiveDateRange != null ? EffectiveDateRange.GetHashCode() : 0);
                result = (result * 397) ^ (WebsiteUrlName != null ? WebsiteUrlName.GetHashCode() : 0);
                result = (result * 397) ^ (GeographicalRegion != null ? GeographicalRegion.GetHashCode() : 0);
                result = (result * 397) ^ (Note != null ? Note.GetHashCode() : 0);
                return(result);
            }
        }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AgencyProfile"/> class.
        /// </summary>
        /// <param name="agencyType">Type of the agency.</param>
        /// <param name="agencyName">Name of the agency.</param>
        /// <param name="effectiveDateRange">The effective date range.</param>
        /// <param name="websiteUrlName">Name of the website URL.</param>
        /// <param name="geographicalRegion">The geographical region.</param>
        /// <param name="note">The note.</param>
        public AgencyProfile(
            AgencyType agencyType,
            AgencyName agencyName,
            DateRange effectiveDateRange,
            string websiteUrlName,
            GeographicalRegion geographicalRegion,
            string note)
        {
            Check.IsNotNull(agencyType, () => AgencyType);
            Check.IsNotNull(agencyName, () => AgencyName);

            AgencyType         = agencyType;
            AgencyName         = agencyName;
            EffectiveDateRange = effectiveDateRange;
            WebsiteUrlName     = websiteUrlName;
            GeographicalRegion = geographicalRegion;
            Note = note;
        }
Пример #3
0
 /// <summary>
 /// Assigns the name of the agency.
 /// </summary>
 /// <param name="agencyName">Name of the agency.</param>
 /// <returns>An AgencyProfileBuilder.</returns>
 public AgencyProfileBuilder WithAgencyName(AgencyName agencyName)
 {
     _agencyName = agencyName;
     return(this);
 }