Example #1
0
        public HttpResponseMessage GetAllByIdCoSoYTe(HttpRequestMessage request, int id)
        {
            IEnumerable <NguoiDung> nguoiDungVoiIdCsyt = null;
            var toTal = 0;

            try
            {
                nguoiDungVoiIdCsyt = _nguoiDungService.GetAllByIdCoSoYTe(id);
                toTal = nguoiDungVoiIdCsyt.ToList().Count;
                if (toTal > 0)
                {
                    Message = "danh sách người dùng với id csyt: " + id;
                }
                else
                {
                    throw new DbEntityValidationException(string.Format("Không tìm kiếm được danh sách người dùng với id csyt {0}", id));
                }
            }
            catch (DbEntityValidationException ex)
            {
                LogException(ex);
            }
            return(GetResponseMessage(IsSuccess, Message, toTal, nguoiDungVoiIdCsyt));
        }