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); }
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); }