예제 #1
0
 public IAutorizationModel Handle(IAutorizationModel request)
 {
     if (request.Login.Contains("email"))
     {
         Console.WriteLine($"NativeEmailAuthorizationHandler handeled the autorization of {request.Login}.\n");
         _ = new NativeAuthorizationService().CheckEmailInDb(request);
         return(request);
     }
     else
     {
         Console.WriteLine($"NativeEmailAuthorizationHandler didn't handele the autorization of {request.Login}.\n");
         if (this._nextHandler != null)
         {
             return(this._nextHandler.Handle(request));
         }
         else
         {
             return(null);
         }
     }
 }
예제 #2
0
 public IAutorizationModel Handle(IAutorizationModel request)
 {
     if (!request.Login.Any(c => char.IsLetter(c)))
     {
         Console.WriteLine($"NativePhoneAuthorizationHandler handeled the autorization of {request.Login}.\n");
         _ = new NativeAuthorizationService().CheckPhoneInDb(request);
         return(request);
     }
     else
     {
         Console.WriteLine($"NativePhoneAuthorizationHandler didn't handele the autorization of {request.Login}.\n");
         if (this._nextHandler != null)
         {
             return(this._nextHandler.Handle(request));
         }
         else
         {
             return(null);
         }
     }
 }