예제 #1
0
        protected virtual ValidationResult ValidateForUpdate(TDto dto)
        {
            var result = new ValidationResult();

            if (dto == null)
            {
                result.AppendMessage("No data was provided.");
            }
            else
            {
                if (dto.Id.Equals(default(TId)))
                {
                    result.AppendMessage("Invalid ID");
                }
            }
            return(result);
        }
예제 #2
0
        protected virtual ValidationResult ValidateForCreation(TDto dto)
        {
            var result = new ValidationResult();

            if (dto == null)
            {
                result.AppendMessage("No data was provided.");
            }
            else
            {
                dto.Id = default(TId);
            }
            return(result);
        }