//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// 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_2<TOutData,TList1_Item,TList2_Item>: 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_1 => _list_1 != null;
   public bool HasList_2 => _list_2 != null;
   /// <exception cref="InvalidOperationException" />
   public List<TList1_Item>? List_1 => GetList(_list_1);
   /// <exception cref="InvalidOperationException" />
   public List<TList2_Item>? List_2 => GetList(_list_2);

   /// <exception cref="InvalidOperationException" />
   [u.strict_result] public List<TList1_Item> ListNN_1 =>
      List_1 ?? throw HSPResultError.OutputListUnavailable_1;
   /// <exception cref="InvalidOperationException" />
   [u.strict_result] public List<TList2_Item> ListNN_2 =>
      List_2 ?? throw HSPResultError.OutputListUnavailable_2;

   public HSPResultOutN_2()
   {}
   public HSPResultOutN_2( HSPResultParameters resultParams,
                           TOutData? output,
                           List<TList1_Item>? list_1,
                           List<TList2_Item>? list_2 )
   : base( resultParams, output )
   {
      _list_1 = list_1;
      _list_2 = list_2;
   }
   public HSPResultOutN_2( HSPResultOut_2<TOutData,TList1_Item,TList2_Item> result )
   : base( result )
   {
      _list_1 = result.GetList_1();
      _list_2 = result.GetList_2();
   }

   /// <exception cref="InvalidOperationException" />
   List<TItem>? GetList<TItem>(List<TItem>? list)
   {
      VerifyAvailable();
      return list;
   }

   readonly List<TList1_Item>? _list_1;
   readonly List<TList2_Item>? _list_2;

} // HSPResultOutN_2<TOutData,TList1_Item,TList2_Item>
//**************************************************************************************************

//**************************************************************************************************
[h_db_orm_type]
public class HSPResultOutRVN_2<TOutData,TList1_Item,TList2_Item>: 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_1 => _list_1 != null;
   public bool HasList_2 => _list_2 != null;
   /// <exception cref="InvalidOperationException" />
   public List<TList1_Item>? List_1 => GetList(_list_1);
   /// <exception cref="InvalidOperationException" />
   public List<TList2_Item>? List_2 => GetList(_list_2);

   /// <exception cref="InvalidOperationException" />
   [u.strict_result] public List<TList1_Item> ListNN_1 =>
      List_1 ?? throw HSPResultError.OutputListUnavailable_1;
   /// <exception cref="InvalidOperationException" />
   [u.strict_result] public List<TList2_Item> ListNN_2 =>
      List_2 ?? throw HSPResultError.OutputListUnavailable_2;

   public HSPResultOutRVN_2()
   {}
   public HSPResultOutRVN_2( HSPResultParameters resultParams,
                             TOutData? output,
                             List<TList1_Item>? list_1,
                             List<TList2_Item>? list_2 )
   : base( resultParams, output )
   {
      _list_1 = list_1;
      _list_2 = list_2;
   }
   public HSPResultOutRVN_2( HSPResultOutRV_2<TOutData,TList1_Item,TList2_Item> result )
   : base( result )
   {
      _list_1 = result.GetList_1();
      _list_2 = result.GetList_2();
   }

   /// <exception cref="InvalidOperationException" />
   List<TItem>? GetList<TItem>(List<TItem>? list)
   {
      VerifyAvailable();
      return list;
   }

   readonly List<TList1_Item>? _list_1;
   readonly List<TList2_Item>? _list_2;

} // HSPResultOutRVN_2<TOutData,TList1_Item,TList2_Item>
//**************************************************************************************************

} // DataHelpers.SQL
