view Agendas/trunk/src/Agendas.Domain/IdentityContext.cs @ 79:8df9db937434

Url de invitación en la UI: validación y persistencia
author nelopauselli
date Tue, 24 May 2011 18:08:59 -0300
parents 3059a5f8930f
children db4b1e2cae49
line wrap: on
line source

using AltNetHispano.Agendas.Domain.Exceptions;

namespace AltNetHispano.Agendas.Domain
{
	public class IdentityContext
	{
		private static ISeguridad _current;

		public static ISeguridad Current
		{
			private get
			{
				if (_current == null)
					throw new IdentityContextNotConfiguredException();
				return _current;
			}
			set { _current = value; }
		}

		public static string GetUserName()
		{
			string username = Current.GetUserName();
			if (string.IsNullOrWhiteSpace(username))
				throw new UsuarioNoAutenticadoException();
			return username;
		}
	}
}