using System;
using System.Collections.Generic;
using System.Linq;

namespace SharpRSS.API.Contracts.Models
{
    public class ListResult<TItem> : ResultOr<IEnumerable<TItem>>
    {
        public ListResult(IEnumerable<TItem>? value, long total, string message = "", ResultStatus status = ResultStatus.Ok) : base(value, message, status)
        {
            TotalFound = total;
        }
        public long TotalFound { get; }
        public int Hits => Value?.Count() ?? 0;
    }
}