EF7 npgsql => ko aux clients => inutile en lib [obsdnx]

This commit is contained in:
2018-05-04 17:04:19 +02:00
parent 4ae095ccb3
commit 4e3845755b
495 changed files with 206 additions and 10500 deletions

View File

@ -1,37 +0,0 @@
using System;
namespace Yavsc.Attributes.Validation
{
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)]
public class YaRequiredAttribute : YaValidationAttribute
{
/// <summary>
/// Gets or sets a flag indicating whether the attribute should allow empty strings.
/// </summary>
public bool AllowEmptyStrings { get; set; }
public YaRequiredAttribute (string msg) : base()
{
ErrorMessage = msg;
}
public YaRequiredAttribute ()
{
this.ErrorMessage = ResourcesHelpers.GlobalLocalizer["RequiredField"];
}
public override bool IsValid(object value) {
if (value == null) {
return false;
}
// only check string length if empty strings are not allowed
var stringValue = value as string;
if (stringValue != null && !AllowEmptyStrings) {
return stringValue.Trim().Length != 0;
}
return true;
}
}
}