|
|
@ -9,13 +9,7 @@ namespace ApiMappeur
|
|
|
|
|
|
|
|
|
|
|
|
public static ChampionDTO ToDTO(this Champion item)
|
|
|
|
public static ChampionDTO ToDTO(this Champion item)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
/*if (item == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var message = string.Format("Champion cannot be empty");
|
|
|
|
|
|
|
|
*//*throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.NotFound, message));
|
|
|
|
|
|
|
|
*//*
|
|
|
|
|
|
|
|
throw new Exception(message);
|
|
|
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
return new ChampionDTO()
|
|
|
|
return new ChampionDTO()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Icon = item.Icon,
|
|
|
|
Icon = item.Icon,
|
|
|
@ -40,9 +34,8 @@ namespace ApiMappeur
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (item == null)
|
|
|
|
if (item == null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var message = string.Format("Champion with name = {} not found", item.Name);
|
|
|
|
var message = string.Format("Champion is null cannot null it ";
|
|
|
|
/*throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.NotFound, message));
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
throw new Exception(message);
|
|
|
|
throw new Exception(message);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -66,8 +59,6 @@ namespace ApiMappeur
|
|
|
|
if (dto == null)
|
|
|
|
if (dto == null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var message = string.Format("Champion cannot be empty");
|
|
|
|
var message = string.Format("Champion cannot be empty");
|
|
|
|
/*throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.NotFound, message));
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
throw new Exception(message);
|
|
|
|
throw new Exception(message);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|