using System;
using System.Collections.Generic;
using Quadarax.Foundation.Core.Data.Interface.Entity;
using Quadarax.Foundation.Core.Data.Interface.Entity.Dto;

namespace Quadarax.Foundation.Core.Web.Extensions
{
    public static class DtoExt
    {
        public static ResultValueDto<TDto> AsResult<TDto>(this TDto value) where TDto : IDto, new()
        {
            if (value==null)
                throw new ArgumentNullException(nameof(value));
            return new ResultValueDto<TDto>(value);
        }
        public static ResultsValueDto<TDto> AsResult<TDto>(this IEnumerable<TDto> values) where TDto : IDto
        {
            if (values==null)
                throw new ArgumentNullException(nameof(values));
            return new ResultsValueDto<TDto>(values);
        }
    }
}
