-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
SoftDeleteColumnDeletionDetectionPolicy.Customization.cs
38 lines (33 loc) · 1.61 KB
/
SoftDeleteColumnDeletionDetectionPolicy.Customization.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
namespace Microsoft.Azure.Search.Models
{
using Common;
public partial class SoftDeleteColumnDeletionDetectionPolicy
{
/// <summary>
/// Initializes a new instance of the SoftDeleteColumnDeletionDetectionPolicy class with required arguments.
/// </summary>
/// <param name="softDeleteColumnName">
/// Specifies the name of the column to use for soft-deletion detection.
/// </param>
/// <param name="softDeleteMarkerValue">
/// Specifies the marker value that indentifies an item as deleted.
/// </param>
public SoftDeleteColumnDeletionDetectionPolicy(string softDeleteColumnName, object softDeleteMarkerValue)
{
Throw.IfArgumentNull(softDeleteColumnName, "softDeleteColumnName");
Throw.IfArgumentNull(softDeleteMarkerValue, "softDeleteMarkerValue");
bool isValidType =
softDeleteMarkerValue is int || softDeleteMarkerValue is long || softDeleteMarkerValue is byte ||
softDeleteMarkerValue is short || softDeleteMarkerValue is string || softDeleteMarkerValue is bool;
Throw.IfArgument(
!isValidType,
"softDeleteMarkerValue",
"Soft-delete marker value must be an integer, string, or bool value.");
this.SoftDeleteColumnName = softDeleteColumnName;
this.SoftDeleteMarkerValue = softDeleteMarkerValue.ToString();
}
}
}