| | | 1 | | using System.Collections.Generic; |
| | | 2 | | using System.Linq; |
| | | 3 | | |
| | | 4 | | namespace ApplicationCore.Model |
| | | 5 | | { |
| | | 6 | | public class CommentResult |
| | | 7 | | { |
| | 4 | 8 | | public bool HasErrors => Errors.Any(); |
| | 7 | 9 | | public Comment Comment { get; } |
| | 7 | 10 | | public IEnumerable<string> Errors { get; } |
| | | 11 | | |
| | 13 | 12 | | public CommentResult(Comment comment) |
| | 13 | 13 | | { |
| | 13 | 14 | | Comment = comment; |
| | 13 | 15 | | Errors = Enumerable.Empty<string>(); |
| | 13 | 16 | | } |
| | | 17 | | |
| | 2 | 18 | | public CommentResult(Comment comment, IEnumerable<string> errors) : this(comment) |
| | 2 | 19 | | { |
| | 2 | 20 | | Errors = errors; |
| | 2 | 21 | | } |
| | | 22 | | } |
| | | 23 | | } |