Home > Net >  The user code untreated System. ArgumentOutOfRangeException HResult=- 2146233086 Message=index beyon
The user code untreated System. ArgumentOutOfRangeException HResult=- 2146233086 Message=index beyon

Time:09-17

Troublesome everybody look great god, this is what the problem is,
StackTrace: in the System. ThrowHelper. ThrowArgumentOutOfRangeException (ExceptionArgument argument, ExceptionResource resource) in the System. The Collections. The Generic. List ` 1. Get_Item (Int32 index Friends. Business. TagSettingService. GetTitle (Int32 prize) location: f, Friends, Friends, Business \ TagSettingService cs: line number 38
In Friends. Controllers. QuestionController. & lt;> C__DisplayClass3. & lt; ListExpert> B__2 (ExpertModel u) location: f \ Friends \ Friends Web \ Controllers \ QuestionController cs: line number 123
In the System. Linq. Enumerable. WhereSelectListIterator ` 2. MoveNext ()
In the System. Collections. Generic. List ` 1.. Ctor (IEnumerable collection ` 1)
In the System. The Linq. Enumerable. ToList [TSource] (IEnumerable ` 1 source)
In Friends. Controllers. QuestionController. ListExpert (position) : f \ Friends \ Friends Web \ Controllers \ QuestionController cs: line number 124
In lambda_method (Closure, ControllerBase, Object [])
In the System. Web. Mvc. ActionMethodDispatcher. Execute (ControllerBase controller, Object [] the parameters)
In the System. Web. Mvc. ReflectedActionDescriptor. Execute (ControllerContext ControllerContext, IDictionary ` 2 parameters)
In the System. Web. Mvc. ControllerActionInvoker. InvokeActionMethod (ControllerContext ControllerContext, ActionDescriptor ActionDescriptor, IDictionary ` 2 parameters)
In the System. Web. Mvc. Async. AsyncControllerActionInvoker. & lt;> C__DisplayClass42. & lt; BeginInvokeSynchronousActionMethod> B__41 ()
In the System. Web. Mvc. Async. AsyncResultWrapper. & lt;> C__DisplayClass8 ` 1. & lt; BeginSynchronous> B__7 (IAsyncResult _)
In the System. Web. Mvc. Async. AsyncResultWrapper. WrappedAsyncResult ` 1. The End ()
In the System. Web. Mvc. Async. AsyncControllerActionInvoker. EndInvokeActionMethod (IAsyncResult asyncResult)
In the System. Web. Mvc. Async. AsyncControllerActionInvoker. & lt;> C__DisplayClass37. & lt;> C__DisplayClass39. & lt; BeginInvokeActionMethodWithFilters> B__33 ()
In the System. Web. Mvc. Async. AsyncControllerActionInvoker. & lt;> C__DisplayClass4f. & lt; InvokeActionMethodFilterAsynchronously> B__49 ()
InnerException:

CodePudding user response:

Set a breakpoint to see you setting any value, if not, explain GetTitleSettings method there is a problem, or it is you the linq statement below query conditions out there is no matching results,

CodePudding user response:

reference 1st floor EdsionWang response:
set a breakpoint to see you setting any value, if not, explain GetTitleSettings method there is a problem, or it is you the linq statement below query conditions out there is no matching result,

Setting as long as it's not null, even inside an element all have no, for the select operation is not wrong, wrong in the title. The building Lord Tolist () [0], found out the title without any elements, but he directly take [0],
So you should
If (title. Tolist (). The count & gt; 0)
Return the title. Tolist () [0];
The else
Return "no value";

CodePudding user response:

Did you look at the title. ToList (),
  • Related