CourseWork/University/UniversityContracts/ViewModels/PlanOfStudyViewModel.cs

35 lines
1.0 KiB
C#
Raw Normal View History

2024-04-18 19:35:33 +04:00
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
2024-04-18 19:35:33 +04:00
using System.Threading.Tasks;
using UniversityDataModels.Models;
namespace UniversityContracts.ViewModels
{
public class PlanOfStudyViewModel : IPlanOfStudyModel
{
public int Id { get; set; }
public int UserId { get; set; }
2024-04-18 19:35:33 +04:00
[DisplayName("Профиль")]
public string Profile { get; set; } = string.Empty;
[DisplayName("Форма обучения")]
public string FormOfStudy { get; set; } = string.Empty;
2024-04-24 14:08:27 +04:00
public Dictionary<int, ITeacherModel> PlanOfStudyTeachers
{
get;
set;
} = new();
public PlanOfStudyViewModel() { }
[JsonConstructor]
public PlanOfStudyViewModel(Dictionary<int, TeacherViewModel> planOfStudyTeachers)
{
this.PlanOfStudyTeachers = planOfStudyTeachers.ToDictionary(x => x.Key, x => x.Value as ITeacherModel);
}
2024-04-18 19:35:33 +04:00
}
}