// ======================================================================== // Copyright 2007 - Volian Enterprises, Inc. All rights reserved. // Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE // ------------------------------------------------------------------------ // $Workfile: $ $Revision: $ // $Author: $ $Date: $ // // $History: $ // ======================================================================== using System.Reflection; namespace VEPROMS.CSLA.Library { /// /// CommonRules Generated by MyGeneration using the CSLA Object Mapping template /// public static class CommonRules { public static bool Required(object target, Csla.Validation.RuleArgs e) { PropertyInfo propertyInfoObj = target.GetType().GetProperty(e.PropertyName); if (propertyInfoObj == null) return true; if (propertyInfoObj.GetValue(target, null) == null) { e.Description = $"{e.PropertyName} is a required field"; return false; } return true; } } }