Mercurial > altnet-hispano
comparison Agendas/trunk/src/Agendas.Domain/IdentityContext.cs @ 50:3ebe89c88caa
Agregando propiedad al Evento sobre el Usuario que lo crea o que realizó la
última modificación.
author | nelopauselli |
---|---|
date | Fri, 13 May 2011 23:29:05 -0300 |
parents | |
children | 3059a5f8930f |
comparison
equal
deleted
inserted
replaced
49:be7a9720fb96 | 50:3ebe89c88caa |
---|---|
1 using AltNetHispano.Agendas.Domain.Exceptions; | |
2 | |
3 namespace AltNetHispano.Agendas.Domain | |
4 { | |
5 public class IdentityContext | |
6 { | |
7 private static ISeguridad _current; | |
8 | |
9 public static ISeguridad Current | |
10 { | |
11 private get { | |
12 if (_current == null) | |
13 throw new IdentityContextNotConfiguredException(); | |
14 return _current; | |
15 } | |
16 set { | |
17 _current = value; | |
18 } | |
19 } | |
20 | |
21 public static string GetUserName() | |
22 { | |
23 var username = Current.GetUserName(); | |
24 if (string.IsNullOrWhiteSpace(username)) | |
25 throw new UsuarioNoAutenticadoException(); | |
26 return username; | |
27 } | |
28 } | |
29 } |