Add project
This commit is contained in:
52
Api/Mapping/Mapper.cs
Normal file
52
Api/Mapping/Mapper.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
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
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user