示例#1
0
        public IEnumerable <sp_carreason_search_Result> search(carReasonModel value)
        {
            try
            {
                if (String.IsNullOrEmpty(value.user_id))
                {
                    throw new Exception("Unauthorized Access");
                }
                var userId = JwtHelper.GetUserIdFromToken(value.user_id);
                if (String.IsNullOrEmpty(userId))
                {
                    throw new Exception("Unauthorized Access");
                }

                StandardCanEntities context = new StandardCanEntities();
                IEnumerable <sp_carreason_search_Result> result = context.sp_carreason_search(value.name).AsEnumerable();
                return(result);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }