using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Microsoft.AspNetCore.Mvc;

using CommonHelpers;

namespace BookRegistry.Server {

//**************************************************************************************************
partial class GeneralApiResponseNI<TItem> {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

internal GeneralApiResponseNI(HSPCommandResult spResult)
: base( spResult )
{}
internal GeneralApiResponseNI(HSPCommandResultRV spResult)
: base( spResult )
{}

//--------------------------------------------------------------------------------------------------

internal GeneralApiResponseNI(HSPResult<TItem> spResult)
: this( spResult, spResult.GetList() )
{}
internal GeneralApiResponseNI(HSPResultRV<TItem> spResult)
: this( spResult, spResult.GetList() )
{}

internal GeneralApiResponseNI(HSPResultN<TItem> spResult)
: this( spResult, spResult.List )
{}
internal GeneralApiResponseNI(HSPResultRVN<TItem> spResult)
: this( spResult, spResult.List )
{}

//==================================================================================================

internal GeneralApiResponseNI(HSPCommandResult spResult,List<TItem>? list)
: base( spResult ) => _Items_ = list;

internal GeneralApiResponseNI(HSPCommandResultRV spResult,List<TItem>? list)
: base( spResult ) => _Items_ = list;

internal GeneralApiResponseNI(bool success,HSPCommandResultRV spResult,List<TItem>? list)
: base( success, spResult ) => _Items_ = list;

//--------------------------------------------------------------------------------------------------

internal GeneralApiResponseNI( HSPCommandResult spResult, List<TItem>? list, string? message )
: base( spResult, message ) => _Items_ = list;

internal GeneralApiResponseNI( HSPCommandResultRV spResult,
                               List<TItem>? list,
                               string? message )
: base( spResult, message ) => _Items_ = list;

internal GeneralApiResponseNI( bool success, HSPCommandResultRV spResult,
                               List<TItem>? list, string? message )
: base( success, spResult, message ) => _Items_ = list;

//==================================================================================================

internal GeneralApiResponseNI( HSPCommandResult spResult, IEnumerable<TItem>? items )
: base( spResult )
{
   if ( items != null )
      _Items_ = new List<TItem>( items );
}

internal GeneralApiResponseNI( HSPCommandResultRV spResult, IEnumerable<TItem>? items )
: base( spResult )
{
   if ( items != null )
      _Items_ = new List<TItem>( items );
}
internal GeneralApiResponseNI( bool success,
                               HSPCommandResultRV spResult,
                               IEnumerable<TItem>? items )
: base( success, spResult )
{
   if ( items != null )
      _Items_ = new List<TItem>( items );
}

//--------------------------------------------------------------------------------------------------

internal GeneralApiResponseNI( HSPCommandResult spResult,
                               IEnumerable<TItem>? items, string? message )
: base( spResult, message )
{
   if ( items != null )
      _Items_ = new List<TItem>( items );
}
internal GeneralApiResponseNI( HSPCommandResultRV spResult,
                               IEnumerable<TItem>? items,
                               string? message )
: base( spResult, message )
{
   if ( items != null )
      _Items_ = new List<TItem>( items );
}
internal GeneralApiResponseNI( bool success, HSPCommandResultRV spResult,
                               IEnumerable<TItem>? items, string? message )
: base( success, spResult, message )
{
   if ( items != null )
      _Items_ = new List<TItem>( items );
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // GeneralApiResponseNI<TItem>
//**************************************************************************************************

} // BookRegistry.Client/Server
