Пример #1
0
        public JsonResultEntity Create([FromBody] CountryEntity countryEntity)
        {
            CountryBL        countryBL = new CountryBL();
            JsonResultEntity response  = new JsonResultEntity();

            try
            {
                var result = countryBL.Create(countryEntity);

                if (result.HasWarning())
                {
                    response.Message = String.Join(",", result.Warning);
                    return(response);
                }

                response.Success = true;
                response.Data    = result.Value;
            }
            catch (Exception ex)
            {
                response.Message = ex.Message;
                LoggerHelper.Error(ex);
            }

            return(response);
        }