mirror of
https://github.com/GCMatters/hermes.git
synced 2026-02-04 05:30:13 +01:00
feat: add first volunteer skill endpoint (add_skill) along with dtos
This commit is contained in:
25
WebApp/Mapping/SkillMapping.cs
Normal file
25
WebApp/Mapping/SkillMapping.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using WebApp.DTOs;
|
||||
using WebApp.Entities;
|
||||
|
||||
namespace WebApp.Mapping
|
||||
{
|
||||
public static class SkillMapping
|
||||
{
|
||||
public static Skill ToSkillEntity(this SingleSkillDto SSDto, string name)
|
||||
{
|
||||
return new Skill()
|
||||
{
|
||||
SkillId = SSDto.Skill,
|
||||
Name = name
|
||||
};
|
||||
}
|
||||
|
||||
public static SkillSummaryDto ToSkillSummaryDto(this Skill s)
|
||||
{
|
||||
return new SkillSummaryDto(
|
||||
s.SkillId,
|
||||
s.Name
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
17
WebApp/Mapping/VolunteerSkillMapping.cs
Normal file
17
WebApp/Mapping/VolunteerSkillMapping.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using WebApp.DTOs;
|
||||
using WebApp.Entities;
|
||||
|
||||
namespace WebApp.Mapping
|
||||
{
|
||||
public static class VolunteerSkillMapping
|
||||
{
|
||||
public static VolunteerSkill ToVolunteerSkillEntity(this SingleSkillDto SSDto, int uid)
|
||||
{
|
||||
return new VolunteerSkill()
|
||||
{
|
||||
UserId = uid,
|
||||
SkillId = SSDto.Skill,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user