//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// 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_2<TOutData,TList1_Item,TList2_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;
   /// <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;

   public HSPResultOut_2()
   {}
   public HSPResultOut_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 HSPResultOut_2( HSPResultOutN_2<TOutData,TList1_Item,TList2_Item> result )
   : base( result )
   {
      _list_1 = result.List_1;
      _list_2 = result.List_2;
   }

   /// <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; }

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

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

//**************************************************************************************************
[h_db_orm_type]
public class HSPResultOutRV_2<TOutData,TList1_Item,TList2_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;
   /// <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;

   public HSPResultOutRV_2()
   {}
   public HSPResultOutRV_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 HSPResultOutRV_2( HSPResultOutRVN_2<TOutData,TList1_Item,TList2_Item> result )
   : base( result )
   {
      _list_1 = result.List_1;
      _list_2 = result.List_2;
   }

   /// <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; }

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

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

} // DataHelpers.SQL
