public Employee Authenticate(Credential credential)
 {
     try
     {
         var result = _manager.Authenticate(CredentialTranslator.ToDomainModel(credential));
         if (result == null)
         {
             return(null);
         }
         return(result.ToDataContract());
     }
     catch (Exception ex)
     {
         //var rethrow = ExceptionPolicy.HandleException("service.policy", ex);
         //if (rethrow) throw;
         //return null;
         throw ex;
     }
 }
示例#2
0
        public async Task <Employee> AuthenticateAsync(Credential credential)
        {
            try
            {
                var result = await _manager.AuthenticateAsync(CredentialTranslator.ToDomainModel(credential));

                if (result == null)
                {
                    return(null);
                }
                return(result.ToDataContract());
            }
            catch (Exception ex)
            {
                var rethrow = ExceptionPolicy.HandleException("service.policy", ex);
                if (rethrow)
                {
                    throw;
                }
                return(null);
            }
        }