//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// 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 HSPResultOut_4<TOutData,TList1_Item,TList2_Item,TList3_Item,TList4_Item>
: HSPCommandResultOut<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;
// [u.strict_result] public TOutData Output;
// [u.strict_result] public string OutMessageNN;
// VerifyAvailable();

   public bool HasList_1 => _list_1 != null;
   public bool HasList_2 => _list_2 != null;
   public bool HasList_3 => _list_3 != null;
   public bool HasList_4 => _list_4 != null;
   /// <exception cref="InvalidOperationException" />
   [u.strict_result] public List<TList1_Item> List_1 =>
      GetList_1() ?? throw HSPResultError.OutputListUnavailable_1;
   /// <exception cref="InvalidOperationException" />
   [u.strict_result] public List<TList2_Item> List_2 =>
      GetList_2() ?? throw HSPResultError.OutputListUnavailable_2;
   /// <exception cref="InvalidOperationException" />
   [u.strict_result] public List<TList3_Item> List_3 =>
      GetList_3() ?? throw HSPResultError.OutputListUnavailable_3;
   /// <exception cref="InvalidOperationException" />
   [u.strict_result] public List<TList4_Item> List_4 =>
      GetList_4() ?? throw HSPResultError.OutputListUnavailable_4;

   public HSPResultOut_4()
   {}
   public HSPResultOut_4( HSPResultParameters resultParams,
                          TOutData? output,
                          List<TList1_Item>? list_1,
                          List<TList2_Item>? list_2,
                          List<TList3_Item>? list_3,
                          List<TList4_Item>? list_4 )
   : base( resultParams, output )
   {
      _list_1 = list_1;
      _list_2 = list_2;
      _list_3 = list_3;
      _list_4 = list_4;
   }
   public HSPResultOut_4( HSPResultOutN_4<TOutData,TList1_Item,TList2_Item,TList3_Item,TList4_Item>
                          result )
   : base( result )
   {
      _list_1 = result.List_1;
      _list_2 = result.List_2;
      _list_3 = result.List_3;
      _list_4 = result.List_4;
   }

   /// <exception cref="InvalidOperationException" />
   public List<TList1_Item>? GetList_1() { VerifyAvailable(); return _list_1; }
   /// <exception cref="InvalidOperationException" />
   public List<TList2_Item>? GetList_2() { VerifyAvailable(); return _list_2; }
   /// <exception cref="InvalidOperationException" />
   public List<TList3_Item>? GetList_3() { VerifyAvailable(); return _list_3; }
   /// <exception cref="InvalidOperationException" />
   public List<TList4_Item>? GetList_4() { VerifyAvailable(); return _list_4; }

   readonly List<TList1_Item>? _list_1;
   readonly List<TList2_Item>? _list_2;
   readonly List<TList3_Item>? _list_3;
   readonly List<TList4_Item>? _list_4;

} // HSPResultOut_4<TOutData,TList1_Item,TList2_Item,TList3_Item,TList4_Item>
//**************************************************************************************************

//**************************************************************************************************
[h_db_orm_type]
public class HSPResultOutRV_4<TOutData,TList1_Item,TList2_Item,TList3_Item,TList4_Item>
: HSPCommandResultOutRV<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;
// [u.strict_result] public TOutData Output;
// [u.strict_result] public string OutMessageNN;
// VerifyAvailable();

   public bool HasList_1 => _list_1 != null;
   public bool HasList_2 => _list_2 != null;
   public bool HasList_3 => _list_3 != null;
   public bool HasList_4 => _list_4 != null;
   /// <exception cref="InvalidOperationException" />
   [u.strict_result] public List<TList1_Item> List_1 =>
      GetList_1() ?? throw HSPResultError.OutputListUnavailable_1;
   /// <exception cref="InvalidOperationException" />
   [u.strict_result] public List<TList2_Item> List_2 =>
      GetList_2() ?? throw HSPResultError.OutputListUnavailable_2;
   /// <exception cref="InvalidOperationException" />
   [u.strict_result] public List<TList3_Item> List_3 =>
      GetList_3() ?? throw HSPResultError.OutputListUnavailable_3;
   /// <exception cref="InvalidOperationException" />
   [u.strict_result] public List<TList4_Item> List_4 =>
      GetList_4() ?? throw HSPResultError.OutputListUnavailable_4;

   public HSPResultOutRV_4()
   {}
   public HSPResultOutRV_4( HSPResultParameters resultParams,
                           TOutData? output,
                           List<TList1_Item>? list_1,
                           List<TList2_Item>? list_2,
                           List<TList3_Item>? list_3,
                           List<TList4_Item>? list_4 )
   : base( resultParams, output )
   {
      _list_1 = list_1;
      _list_2 = list_2;
      _list_3 = list_3;
      _list_4 = list_4;
   }
   public HSPResultOutRV_4( HSPResultOutRVN_4<TOutData,
                                              TList1_Item,TList2_Item,TList3_Item,TList4_Item>
                            result )
   : base( result )
   {
      _list_1 = result.List_1;
      _list_2 = result.List_2;
      _list_3 = result.List_3;
      _list_4 = result.List_4;
   }

   /// <exception cref="InvalidOperationException" />
   public List<TList1_Item>? GetList_1() { VerifyAvailable(); return _list_1; }
   /// <exception cref="InvalidOperationException" />
   public List<TList2_Item>? GetList_2() { VerifyAvailable(); return _list_2; }
   /// <exception cref="InvalidOperationException" />
   public List<TList3_Item>? GetList_3() { VerifyAvailable(); return _list_3; }
   /// <exception cref="InvalidOperationException" />
   public List<TList4_Item>? GetList_4() { VerifyAvailable(); return _list_4; }

   readonly List<TList1_Item>? _list_1;
   readonly List<TList2_Item>? _list_2;
   readonly List<TList3_Item>? _list_3;
   readonly List<TList4_Item>? _list_4;

} // HSPResultOutRV_4<TOutData,TList1_Item,TList2_Item,TList3_Item,TList4_Item>
//**************************************************************************************************

} // DataHelpers.SQL
