예제 #1
0
        public async Task <string> GetCopertina(CopertinaModel model)
        {
            var result = string.Empty;
            var body   = string.Empty;

            try
            {
                var requestUrl = $"{apiUrl}/emendamenti/template/copertina";
                body = JsonConvert.SerializeObject(model);

                result = await Post(requestUrl, body, _token);

                var lst = JsonConvert.DeserializeObject <string>(result);
                return(lst);
            }
            catch (UnauthorizedAccessException ex)
            {
                Log.Error("GetCopertina", ex);
                throw ex;
            }
            catch (Exception ex)
            {
                Log.Error($"GetCopertina PARAMS: [{body}]");
                Log.Error($"GetCopertina RESULT: [{result}]");
                Log.Error("GetCopertina", ex);
                throw ex;
            }
        }
예제 #2
0
        public async Task <IHttpActionResult> GetBodyCopertina(CopertinaModel model)
        {
            try
            {
                var body = await _logicEm.GetCopertina(model);

                return(Ok(body));
            }
            catch (Exception e)
            {
                Log.Error("GetBodyCopertina", e);
                return(ErrorHandler(e));
            }
        }