You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

LuDboExtensions.cs 570B

12345678910111213141516171819202122
  1. using System;
  2. using Luticate2.Auth.Utils.Dbo.Result;
  3. namespace Luticate2.Auth.Utils.Dbo
  4. {
  5. public static class LuDboExtensions
  6. {
  7. public static int ToInt(this LuStatus status)
  8. {
  9. return (int) status;
  10. }
  11. public static LuResult<TTypeTo> Select<TTypeFrom, TTypeTo>(this LuResult<TTypeFrom> result, Func<TTypeFrom, TTypeTo> convert)
  12. {
  13. if (!result)
  14. {
  15. return result.To<TTypeTo>();
  16. }
  17. return LuResult<TTypeTo>.Ok(convert(result.Data));
  18. }
  19. }
  20. }