選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

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. }