view Agendas/trunk/src/Agendas.Domain/Cuenta.cs @ 115:7a2eeb9e9bf9

Crear cuenta interna asociada
author Nelo@Kenia.neluz.int
date Sun, 12 Jun 2011 01:40:09 -0300
parents db4b1e2cae49
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();
			}
		}
	}
}