diff Agendas/trunk/src/Agendas.Domain/Services/PersonaService.cs @ 115:7a2eeb9e9bf9

Crear cuenta interna asociada
author Nelo@Kenia.neluz.int
date Sun, 12 Jun 2011 01:40:09 -0300
parents 0bca45e1e664
children 2dbb15f4510f
line wrap: on
line diff
--- a/Agendas/trunk/src/Agendas.Domain/Services/PersonaService.cs	Sat Jun 11 12:50:44 2011 -0300
+++ b/Agendas/trunk/src/Agendas.Domain/Services/PersonaService.cs	Sun Jun 12 01:40:09 2011 -0300
@@ -19,12 +19,12 @@
 			return cuenta != null;
 		}
 
-		public bool Validate(IdentityProviderEnum identityProvider, string username, string nombre)
+		public bool CreateIfNotExist(IdentityProviderEnum identityProvider, string username, string nombre)
 		{
 			var cuenta = _personaRepository.GetCuenta(identityProvider, username);
 			if (cuenta==null)
 			{
-				var persona=new Persona(nombre);
+				var persona = IdentityContext.IsAuthenticated() ? IdentityContext.GetUsuario() : new Persona(nombre);
 				persona.AddCuenta(new Cuenta(identityProvider, username));
 
 				if (identityProvider == IdentityProviderEnum.Twitter)