Class DataSourceUniqueAttribute
Used only against the IDataSource object to validate that 3rd party data source keys are unique (if they are set as being unique in the IDataSourceType)
This should not be used against any other class for validation
Inheritance
DataSourceUniqueAttribute
Inherited Members
Namespace: LemonEdge.API.Attributes.Validation
Assembly: LemonEdge.API.dll
Syntax
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Interface, Inherited = false, AllowMultiple = true)]
public class DataSourceUniqueAttribute : MultipleUniqueAttribute
Constructors
DataSourceUniqueAttribute()
Declaration
public DataSourceUniqueAttribute()
Properties
JointUniqueProperties
The list of properties to ensure the combination of is always unique in the database
Declaration
public override string[] JointUniqueProperties { get; set; }
Property Value
Type | Description |
---|---|
string[] |
Overrides
Methods
GetItemsToCheckFilter(List<IBaseEntity>, IReadOnlyCache)
Declaration
protected override Task<QueryableFilter> GetItemsToCheckFilter(List<IBaseEntity> items, IReadOnlyCache cache)
Parameters
Type | Name | Description |
---|---|---|
List<IBaseEntity> | items | |
IReadOnlyCache | cache |
Returns
Type | Description |
---|---|
Task<QueryableFilter> |
Overrides
IsValid(object, IEntityUpdater, IReadOnlyCache, UserInfo, ValidationContext)
The validation method to return if the item, and changes, are valid or not
Declaration
protected override Task<ValidationResult> IsValid(object value, IEntityUpdater dbCon, IReadOnlyCache cache, UserInfo user, ValidationContext validationContext)
Parameters
Type | Name | Description |
---|---|---|
object | value | The item to be validated |
IEntityUpdater | dbCon | A connection to the database to use for validation |
IReadOnlyCache | cache | A local cache of current items to speed validation |
UserInfo | user | The current logged in user who made the changes |
ValidationContext | validationContext | The validation context across all changes |
Returns
Type | Description |
---|---|
Task<ValidationResult> | A task holding the validation result |
Overrides
MultipleUniqueAttribute.IsValid(object, IEntityUpdater, IReadOnlyCache, UserInfo, ValidationContext)