53 lines
1.3 KiB
C#
53 lines
1.3 KiB
C#
using Api.Database.Entities;
|
|
using Common.Dtos.Season;
|
|
using Common.Dtos.Specialization;
|
|
using Common.Dtos.Student;
|
|
using Common.Dtos.Subject;
|
|
|
|
namespace Api.Mapping;
|
|
|
|
public static class Mapper
|
|
{
|
|
public static SpecializationDto ToSpecializationDto(this Specialization specialization)
|
|
{
|
|
return new SpecializationDto
|
|
{
|
|
Id = specialization.Id,
|
|
Name = specialization.Name,
|
|
ShortName = specialization.ShortName
|
|
};
|
|
}
|
|
|
|
public static SubjectDto ToSubjectDto(this Subject subject)
|
|
{
|
|
return new SubjectDto
|
|
{
|
|
Id = subject.Id,
|
|
Name = subject.Name,
|
|
ShortName = subject.ShortName
|
|
};
|
|
}
|
|
|
|
public static SeasonDto ToSeasonDto(this Season season)
|
|
{
|
|
return new SeasonDto
|
|
{
|
|
Id = season.Id,
|
|
Name = season.Name,
|
|
StartDate = season.StartDate,
|
|
EndDate = season.EndDate
|
|
};
|
|
}
|
|
|
|
public static StudentBasicDto ToStudentBasicDto(this Student student)
|
|
{
|
|
return new StudentBasicDto
|
|
{
|
|
Id = student.Id,
|
|
FirstName = student.FirstName,
|
|
LastName = student.LastName,
|
|
AlbumNumber = student.AlbumNumber
|
|
};
|
|
}
|
|
}
|