//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// CommonHelpers satellite library | Author: Sergei Y.Kitáev
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
using System;
using System.Collections.Generic;
using System.Data.SqlClient;

namespace CommonHelpers {

//**************************************************************************************************
[HDbOrmType]
public class HSPResult_2<TList1_Item,TList2_Item>
: HSPCommandResult
{
// public SPResultStateForm StateForm;
// public bool IsAvailable;
// public bool Success;
// [HOptionalValue] public Guid Status;
// [HOptionalValue] public string? OutMessage;
// [HNotNull] public string ErrorMessage;
// [HStrictResult] public string OutMessageNN;
// [HStrictResult] public TOutData Output;
// VerifyAvailable();

   public bool HasList_1 => _List_1_ != null;
   public bool HasList_2 => _List_2_ != null;
   /// <exception cref="InvalidOperationException" />
   [HStrictResult] public List<TList1_Item> List_1 =>
      GetList_1() ?? throw HSPResultError.OutputListUnavailable_1;
   /// <exception cref="InvalidOperationException" />
   [HStrictResult] public List<TList2_Item> List_2 =>
      GetList_2() ?? throw HSPResultError.OutputListUnavailable_2;

   public HSPResult_2()
   {}
   public HSPResult_2( HSPResultParameters resultParams,
                       [HOptional] List<TList1_Item>? list_1,
                       [HOptional] List<TList2_Item>? list_2 )
   : base( resultParams )
   {
      _List_1_ = list_1;
      _List_2_ = list_2;
   }
   public HSPResult_2( HSPResultN_2<TList1_Item,TList2_Item> result )
   : base( result.Success, result.Status, result.OutMessage )
   {
      _List_1_ = result.List_1;
      _List_2_ = result.List_2;
   }

   /// <exception cref="InvalidOperationException" />
   [HOptionalResult]
   public List<TList1_Item>? GetList_1() { VerifyAvailable(); return _List_1_; }
   /// <exception cref="InvalidOperationException" />
   [HOptionalResult]
   public List<TList2_Item>? GetList_2() { VerifyAvailable(); return _List_2_; }

   readonly List<TList1_Item>? _List_1_;
   readonly List<TList2_Item>? _List_2_;

} // HSPResult_2<TList1_Item,TList2_Item>
//**************************************************************************************************

//**************************************************************************************************
[HDbOrmType]
public class HSPResultRV_2<TList1_Item,TList2_Item>
: HSPCommandResultRV
{
// public SPResultStateForm StateForm;
// public bool IsAvailable;
// public int RetValue;
// [HOptionalValue] public Guid Status;
// [HOptionalValue] public string? OutMessage;
// [HNotNull] public string OutMessageAsError;
// [HStrictResult] public string OutMessageNN;
// [HStrictResult] public TOutData Output;
// VerifyAvailable();

   public bool HasList_1 => _List_1_ != null;
   public bool HasList_2 => _List_2_ != null;
   /// <exception cref="InvalidOperationException" />
   [HStrictResult] public List<TList1_Item> List_1 =>
      GetList_1() ?? throw HSPResultError.OutputListUnavailable_1;
   /// <exception cref="InvalidOperationException" />
   [HStrictResult] public List<TList2_Item> List_2 =>
      GetList_2() ?? throw HSPResultError.OutputListUnavailable_2;

   public HSPResultRV_2()
   {}
   public HSPResultRV_2( HSPResultParameters resultParams,
                         [HOptional] List<TList1_Item>? list_1,
                         [HOptional] List<TList2_Item>? list_2 )
   : base( resultParams )
   {
      _List_1_ = list_1;
      _List_2_ = list_2;
   }
   public HSPResultRV_2( HSPResultRVN_2<TList1_Item,TList2_Item> result )
   : base( result.RetValue, result.Status, result.OutMessage )
   {
      _List_1_ = result.List_1;
      _List_2_ = result.List_2;
   }

   /// <exception cref="InvalidOperationException" />
   [HOptionalResult]
   public List<TList1_Item>? GetList_1() { VerifyAvailable(); return _List_1_; }
   /// <exception cref="InvalidOperationException" />
   [HOptionalResult]
   public List<TList2_Item>? GetList_2() { VerifyAvailable(); return _List_2_; }

   readonly List<TList1_Item>? _List_1_;
   readonly List<TList2_Item>? _List_2_;

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

} // CommonHelpers
