12345678910111213141516171819202122 |
- using System;
- using Luticate2.Auth.Utils.Dbo.Result;
-
- namespace Luticate2.Auth.Utils.Dbo
- {
- public static class LuDboExtensions
- {
- public static int ToInt(this LuStatus status)
- {
- return (int) status;
- }
-
- public static LuResult<TTypeTo> Select<TTypeFrom, TTypeTo>(this LuResult<TTypeFrom> result, Func<TTypeFrom, TTypeTo> convert)
- {
- if (!result)
- {
- return result.To<TTypeTo>();
- }
- return LuResult<TTypeTo>.Ok(convert(result.Data));
- }
- }
- }
|