public ActionResult <ServiceSubscriptionDto> CreateServiceSubscription([FromBody] ServiceSubscriptionDto dto) { ServiceSubscriptionDto createdDto; try { createdDto = _serviceSubscriptionService.Create(dto); } catch (KeyNotFoundException e) { return(NotFound(e.Message)); } return(Ok(createdDto)); }
public ActionResult <ServiceSubscriptionDto> UpdateServiceSubscription(int id, [FromBody] ServiceSubscriptionDto dto) { try { return(Ok(_serviceSubscriptionService.Update(id, dto))); } catch (KeyNotFoundException e) { return(NotFound($"{e.Message} ID: {id}")); } }