view Agendas/trunk/src/Agendas.Domain/Cuenta.cs @ 300:48ab8788bd19

#200: Patrocinadores: Agregar link al sitio web.
author juanjose.montesdeocaarbos
date Mon, 27 Feb 2012 14:45:12 -0300
parents 7a2eeb9e9bf9
children
line wrap: on
line source

namespace AltNetHispano.Agendas.Domain
{
	public class Cuenta : Identificable
	{
		public virtual Persona Persona { get; set; }
		public virtual string LogonName { get; set; }
		public virtual IdentityProviderEnum IdentityProvider { get; set; }

		protected Cuenta()
		{
		}

		public Cuenta(IdentityProviderEnum identityProvider, string logonName)
		{
			LogonName = logonName;
			IdentityProvider = identityProvider;
		}

		public override bool Equals(object obj)
		{
			if (ReferenceEquals(null, obj)) return false;
			if (ReferenceEquals(this, obj)) return true;
			if (obj.GetType() != typeof (Cuenta)) return false;
			return Equals((Cuenta) obj);
		}

		public virtual bool Equals(Cuenta other)
		{
			if (ReferenceEquals(null, other)) return false;
			if (ReferenceEquals(this, other)) return true;
			return Equals(other.LogonName, LogonName) && Equals(other.IdentityProvider, IdentityProvider);
		}

		public override int GetHashCode()
		{
			unchecked
			{
				return ((LogonName != null ? LogonName.GetHashCode() : 0)*397) ^ IdentityProvider.GetHashCode();
			}
		}
	}
}