Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

LuExceptionsExtensions.cs 491B

123456789101112131415161718192021
  1. using Luticate2.Auth.Dbo.Result;
  2. namespace Luticate2.Auth.Exceptions
  3. {
  4. public static class LuExceptionsExtensions
  5. {
  6. public static void Throw<T>(this LuResult<T> result)
  7. {
  8. throw new LuResultException(result.To<object>());
  9. }
  10. public static LuResult<T> ThrowIfNotSuccess<T>(this LuResult<T> result)
  11. {
  12. if (!result)
  13. {
  14. result.Throw();
  15. }
  16. return result;
  17. }
  18. }
  19. }