public void AddSubscriptionToUser(AddSubcriptionToUser addSubcriptionToUser)
 {
     try
     {
         CommandService.AddSubscriptionToUser(addSubcriptionToUser);
     }
     catch (Exception ex)
     {
         Logger.LogError(ex);
         throw new FaultException(ex.Message);
     }
 }
Exemplo n.º 2
0
        public async Task <IHttpActionResult> AddSubscriptionToUser([FromUri] Guid id, [FromBody] AddSubcriptionToUser request)
        {
            try
            {
                await CommandService.AddSubscriptionToUser(id, request.SubscriptionId);

                return(Ok());
            }
            catch (Exception ex)
            {
                Logger.LogError(ex);
                // Can be fine tuned to throw a general exception instead of sending the server exception
                return(InternalServerError(ex));
            }
        }