コード例 #1
0
        protected bool ValidateEntity <T>(T entity) where T : Entity
        {
            if (_notifications.HasNotification())
            {
                return(false);
            }

            var validationResult = entity.Validate();

            if (validationResult.IsValid)
            {
                return(true);
            }

            _notifications.HandleNotification(validationResult);
            return(false);
        }
コード例 #2
0
 protected void AddNotification(string message)
 {
     _notifications.HandleNotification("ApiValidation", message);
 }