示例#1
0
        public ResponseModel Create(RequestModel model)
        {
            var response = new ResponseModel();
            var cityBL   = new CityBL();

            return(cityBL.Create(model.Data));
        }
        public JsonResultEntity Create([FromBody] CityEntity cityEntity)
        {
            CityBL           cityBL   = new CityBL();
            JsonResultEntity response = new JsonResultEntity();

            try
            {
                var result = cityBL.Create(cityEntity);

                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);
        }