Пример #1
0
        public HttpResponseMessage GetProvinces()
        {
            ResultMsg resultMsg = new ResultMsg();

            try
            {
                using (IProvince repository = new ProvinceRepository())
                {
                    var list = repository.FindAll();
                    resultMsg.code = 0;
                    resultMsg.data = list;
                }
            }
            catch (Exception ex)
            {
                resultMsg.code = (int)StatusCodeEnum.Error;
                resultMsg.msg  = ex.Message;
            }
            return(resultMsg.toJson());
        }
Пример #2
0
 public IActionResult Index()
 {
     return(View(provinceRepository.FindAll()));
 }