| | 1 | | namespace Syki.Shared; |
| | 2 | |
|
| | 3 | | public class GetCoursesOut |
| | 4 | | { |
| | 5 | | public int Total { get; set; } |
| | 6 | | public List<GetCoursesItemOut> Items { get; set; } = []; |
| | 7 | |
|
| | 8 | | public static IEnumerable<(string, GetCoursesOut)> GetExamples() => |
| | 9 | | [ |
| | 10 | | ("Courses", |
| | 11 | | new GetCoursesOut() |
| | 12 | | { |
| | 13 | | Total = 3, |
| | 14 | | Items = |
| | 15 | | [ |
| | 16 | | new GetCoursesItemOut |
| | 17 | | { |
| | 18 | | Id = Guid.NewGuid(), |
| | 19 | | Name = "ADS", |
| | 20 | | Type = CourseType.Tecnologo, |
| | 21 | | }, |
| | 22 | | new GetCoursesItemOut |
| | 23 | | { |
| | 24 | | Id = Guid.NewGuid(), |
| | 25 | | Name = "Medicina", |
| | 26 | | Type = CourseType.Bacharelado, |
| | 27 | | }, |
| | 28 | | new GetCoursesItemOut |
| | 29 | | { |
| | 30 | | Id = Guid.NewGuid(), |
| | 31 | | Name = "Direito", |
| | 32 | | Type = CourseType.Bacharelado, |
| | 33 | | }, |
| | 34 | | ], |
| | 35 | | }), |
| | 36 | | ]; |
| | 37 | | } |
| | 38 | |
|
| | 39 | | public class GetCoursesItemOut |
| | 40 | | { |
| 170 | 41 | | public Guid Id { get; set; } |
| 170 | 42 | | public string Name { get; set; } |
| 170 | 43 | | public CourseType Type { get; set; } |
| | 44 | |
|
| | 45 | | public override bool Equals(object? obj) |
| | 46 | | { |
| 0 | 47 | | if (obj is null) return false; |
| 0 | 48 | | return Id == ((GetCoursesItemOut)obj).Id; |
| | 49 | | } |
| | 50 | |
|
| | 51 | | public override int GetHashCode() |
| | 52 | | { |
| 0 | 53 | | return Id.ToHashCode(); |
| | 54 | | } |
| | 55 | |
|
| | 56 | | public override string ToString() |
| | 57 | | { |
| 0 | 58 | | return Name; |
| | 59 | | } |
| | 60 | | } |