-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathGroupViewModel.cs
More file actions
41 lines (32 loc) · 1.03 KB
/
GroupViewModel.cs
File metadata and controls
41 lines (32 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace HwProj.Models.CoursesService.ViewModels
{
public class GroupViewModel
{
public long Id { get; set; }
public string Name { get; set; }
public string[] StudentsIds { get; set; }
}
public class CreateGroupViewModel
{
public string Name { get; set; }
[Required]
public string[] GroupMatesIds { get; set; }
[Required]
public long CourseId { get; set; }
public CreateGroupViewModel(string[] groupMatesIds, long courseId)
{
Name = "";
GroupMatesIds = groupMatesIds;
CourseId = courseId;
}
}
public class UpdateGroupViewModel
{
[RegularExpression(@"^\S+.*", ErrorMessage = "Name shouldn't start with white spaces.")]
public string Name { get; set; }
public List<long> Tasks { get; set; } = new List<long>();
public List<GroupMateViewModel> GroupMates { get; set; }
}
}