Files
DiunaBI/DiunaBI.Infrastructure/Plugins/BaseDataValidator.cs
2025-12-15 20:05:26 +01:00

22 lines
646 B
C#

using DiunaBI.Domain.Entities;
using DiunaBI.Infrastructure.Interfaces;
namespace DiunaBI.Infrastructure.Plugins;
public abstract class BaseDataValidator : IDataValidator
{
public abstract string ValidatorType { get; }
public virtual bool CanValidate(string validatorType) => ValidatorType == validatorType;
public abstract void Validate(Layer validationWorker);
/// <summary>
/// Helper method to get record value by code from layer records
/// </summary>
protected string? GetRecordValue(ICollection<Record> records, string code)
{
return records.FirstOrDefault(x => x.Code == code)?.Desc1;
}
}