Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MultiSetSingleArgs{TItem}"/> class.
 /// </summary>
 /// <param name="mapper">The <see cref="DatabaseMapper{TItem}"/> for the <see cref="DatabaseRecord"/>.</param>
 /// <param name="result">The action that will be invoked with the result of the set.</param>
 /// <param name="isMandatory">Indicates whether the value is mandatory; defaults to <c>true</c>.</param>
 /// <param name="stopOnNull">Indicates whether to stop further query result set processing where the current set has resulted in a null (i.e. no records).</param>
 public MultiSetSingleArgs(DatabaseMapper <TItem> mapper, Action <TItem> result, bool isMandatory = true, bool stopOnNull = false)
 {
     Mapper      = Check.NotNull(mapper, nameof(mapper));
     _result     = Check.NotNull(result, nameof(result));
     IsMandatory = isMandatory;
     StopOnNull  = stopOnNull;
 }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MultiSetCollArgs{TColl, TItem}"/> class.
 /// </summary>
 /// <param name="mapper">The <see cref="DatabaseMapper{TItem}"/> for the <see cref="DatabaseRecord"/>.</param>
 /// <param name="result">The action that will be invoked with the result of the set.</param>
 /// <param name="minRows">The minimum number of rows allowed.</param>
 /// <param name="maxRows">The maximum number of rows allowed.</param>
 /// <param name="stopOnNull">Indicates whether to stop further query result set processing where the current set has resulted in a null (i.e. no records).</param>
 public MultiSetCollArgs(DatabaseMapper <TItem> mapper, Action <TColl> result, int minRows = 0, int?maxRows = null, bool stopOnNull = false)
 {
     Mapper  = Check.NotNull(mapper, nameof(mapper));
     _result = Check.NotNull(result, nameof(result));
     Check.IsTrue(!maxRows.HasValue || minRows <= maxRows.Value, nameof(maxRows), "Max Rows is less than Min Rows.");
     MinRows    = minRows;
     MaxRows    = maxRows;
     StopOnNull = stopOnNull;
 }