예제 #1
0
 public IActionResult UpdateInternship([FromBody] InternshipMainAttributesViewModel internshipView, int id)
 {
     try
     {
         var internship = InternshipMapper.ToActualInternshipObject(internshipView);
         _internshipService.UpdateInternship(internship, id);
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
     return(Ok());
 }
예제 #2
0
 public static Internship ToActualInternshipObject(InternshipMainAttributesViewModel internshipView)
 {
     return(new Internship()
     {
         Description = internshipView.Description,
         Places = internshipView.Places,
         Topics = internshipView.Topics,
         Start = DateTime.Parse(internshipView.Start),
         End = DateTime.Parse(internshipView.End),
         Weeks = internshipView.Weeks,
         Name = internshipView.Name
     });
 }