Class SoDuplicateChecker
Inherited Members
Namespace: SuperOffice.Data
Assembly: SoDataBase.BusinessLogic.dll
Syntax
public static class SoDuplicateChecker
Methods
CheckIfFieldHasValueAsync(FieldInfo, object, int?, CancellationToken)
Declaration
public static Task<bool> CheckIfFieldHasValueAsync(this FieldInfo field, object value, int? excludedPrimaryKey = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| FieldInfo | field | |
| object | value | |
| int? | excludedPrimaryKey | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<bool> |
CheckIfMultilingualFieldHasDuplications(FieldInfo, string, int?, CancellationToken)
Checks a field which is supposed to be multilingual like (US:"Request";GE:"Anfrage")
Declaration
public static Task<(bool isDuplication, string language, string value)> CheckIfMultilingualFieldHasDuplications(this FieldInfo field, string value, int? excludedPrimaryKey = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| FieldInfo | field | The multilingual field to check |
| string | value | Value to check |
| int? | excludedPrimaryKey | Id of the row to skip (useful when updating the row) |
| CancellationToken | cancellationToken | The cancellation token |
Returns
| Type | Description |
|---|---|
| Task<(bool isDuplication, string language, string value)> | A tuple which indicates whether the value for the field is a duplication and specifies the language and value if duplication is found |