public void AddSubscriptionToUser(AddSubcriptionToUser addSubcriptionToUser)
 {
     try
     {
         CommandService.AddSubscriptionToUser(addSubcriptionToUser);
     }
     catch (Exception ex)
     {
         Logger.LogError(ex);
         throw new FaultException(ex.Message);
     }
 }
예제 #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));
            }
        }