using DotBased.Monads; namespace Manager.App.Models.System; public class ListResult : Result> { protected ListResult(List result, int total) : base(result) { Total = total; } protected ListResult(Exception exception) : base(exception) { Total = 0; } protected ListResult(ResultError error) : base(error) { Total = 0; } public int Total { get; set; } public static implicit operator ListResult(ResultError error) => new(error); public static implicit operator ListResult(Exception exception) => new(exception); public static implicit operator ListResult(List result) => new(result, 0); public static implicit operator ListResult(ListResultReturn result) => new(result.List, result.Total); } public record ListResultReturn(List List, int Total);