//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// DataHelpers.SQL satellite library | Author: Sergei Y.Kitáev
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using u = user_rtx;

namespace DataHelpers.SQL {

//**************************************************************************************************
[h_db_orm_type]
public class HSPResultOutN<TOutData,TListItem>: HSPCommandResultOutN<TOutData>
where TOutData: class
{
// public SPResultStateForm StateForm;
// public bool IsAvailable;
// public bool Success;
// [u.opt_value] public Guid Status;
// public string? OutMessage;
// public string ErrorMessage;
// public readonly TOutData? Output;
// [u.strict_result] public string OutMessageNN;
// [u.strict_result] public TOutData OutputNN;
// VerifyAvailable();

   public bool HasList => _list != null;
   /// <exception cref="InvalidOperationException" />
   public List<TListItem>? List {
      get {
         VerifyAvailable();
         return _list;
      }}
   /// <exception cref="InvalidOperationException" />
   [u.strict_result] public List<TListItem> ListNN =>
      List ?? throw HSPResultError.OutputListUnavailable;

   public HSPResultOutN()
   {}
   public HSPResultOutN( HSPResultParameters resultParams,
                         TOutData? output,
                         List<TListItem>? list )
   : base( resultParams, output ) =>
      _list = list;
   public HSPResultOutN( HSPResultOut<TOutData,TListItem> result )
   : base( result ) =>
      _list = result.GetList();

   readonly List<TListItem>? _list;

} // HSPResultOutN<TOutData,TListItem>
//**************************************************************************************************

//**************************************************************************************************
[h_db_orm_type]
public class HSPResultOutRVN<TOutData,TListItem>: HSPCommandResultOutRVN<TOutData>
where TOutData: class
{
// public SPResultStateForm StateForm;
// public bool IsAvailable;
// public int RetValue;
// [u.opt_value] public Guid Status;
// public string? OutMessage;
// public string OutMessageAsError;
// public readonly TOutData? Output;
// [u.strict_result] public string OutMessageNN;
// [u.strict_result] public TOutData OutputNN;
// VerifyAvailable();

   public bool HasList => _list != null;
   /// <exception cref="InvalidOperationException" />
   public List<TListItem>? List {
      get {
         VerifyAvailable();
         return _list;
      }}
   /// <exception cref="InvalidOperationException" />
   [u.strict_result] public List<TListItem> ListNN =>
      List ?? throw HSPResultError.OutputListUnavailable;

   public HSPResultOutRVN()
   {}
   public HSPResultOutRVN( HSPResultParameters resultParams,
                           TOutData? output,
                           List<TListItem>? list )
   : base( resultParams, output ) =>
      _list = list;
   public HSPResultOutRVN( HSPResultOutRV<TOutData,TListItem> result )
   : base( result ) =>
      _list = result.GetList();

   readonly List<TListItem>? _list;

} // HSPResultOutRVN<TOutData,TListItem>
//**************************************************************************************************

} // DataHelpers.SQL
