Friday 19 June 2015

The method 'First' can only be used as a final query operation.

Server Error in '/' Application.

The method 'First' can only be used as a final query operation. Consider using the method 'FirstOrDefault' in this instance instead.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NotSupportedException: The method 'First' can only be used as a final query operation. Consider using the method 'FirstOrDefault' in this instance instead.

Source Error:

Line 514:                        {
Line 515:                            user = new User();
Line 516:                            user = exuser.First();
Line 517:                        }
Line 518:                    }