コード例 #1
0
ファイル: PeasyDemo.cs プロジェクト: EugeneMac/PeasyDemo
        protected override void OnValidate()
        {
            var result = (from person in _dp.GetAll() where person.SSN == _ssn select person).Count <Person>();

            if (result != 0)
            {
                Invalidate("SSN of a new person should be unique! A person with this SSN is already in the database!");
            }
        }
コード例 #2
0
 /// <summary>
 /// Invoked by GetAllCommand() if validation and business rules execute successfully
 /// </summary>
 protected virtual IEnumerable <T> GetAll(ExecutionContext <T> context)
 {
     return(_dataProxy.GetAll());
 }