HttpPost Route api register usercard public IHttpActionResult Register

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
[HttpPost]
[Route("api/register/usercard")]
public IHttpActionResult RegisterUserCard(UserCardModel userCard) {
registrationService.RegisterUserCard(mapper.Map<UserCardModel, UserCardDTO>(userCard));
return Ok();
}
[HttpPut]
[Route("api/update/usercard")]
public IHttpActionResult UpdateUserCard(UserCardModel userCard) {
try {
registrationService.UpdateUserCard(mapper.Map<UserCardModel, UserCardDTO>(userCard));
return Ok();
} catch (UserCardNotFoundException e) {
return InternalServerError(e);
}
}
[HttpDelete]
[Route("api/update/usercard")]
public IHttpActionResult DeleteUserCard(UserCardModel userCard) {
try {
registrationService.DeleteUserCard(
mapper.Map<UserCardModel, UserCardDTO>(userCard)
);
return Ok();
} catch (UserCardNotFoundException e) {
return InternalServerError(e);
}
}
[HttpGet]
[Route("api/search/usercard")]