Esempio n. 1
0
        public IActionResult GetWithParent(Guid entityId)
        {
            var res = new ResponeResult();
            // lấy dữ liệu từ database
            var entitie = _wardService.GetWardWithDistrict(entityId);

            // Kiểm tra dữ liệu trả về
            if (entitie == null)
            {
                res.OnBadRequest(res);
                res.DevMsg  = "Không có data !";
                res.UserMsg = "Không tìm thấy tỉnh !";
                res.Data    = entitie;
                return(Ok(res));
            }
            else
            {
                res.OnSuccess(res);
                res.DevMsg  = "Lấy dữ liệu thành công!";
                res.UserMsg = "Lấy dữ liệu thành công!";
                res.Data    = entitie;
                return(Ok(res));
            }
        }
Esempio n. 2
0
        public IActionResult Get(Guid?districtId)
        {
            var responseResult = _wardService.GetWardWithDistrict(districtId);

            return(Ok(responseResult));
        }