Barefoot learning LINQ (040): This causes an exception in the instance where the object is not referenced.

Source: Internet
Author: User

Demo Video: http://u.115.com/file/f2737fb613

Demonstration highlights
This demonstration focuses on obtaining associated data objects through the foreign key navigation, if the relevant data records are not found, will this cause the exception of not setting the object reference to the object instance?
First, the test results show that, in this case, even if the relevant data records are not found, it will not cause the aforementioned exceptions.
However, if no relevant data record is found when obtaining a single-party associated data object from the collection party, the exception that the object reference is not set to the object instance will be thrown. Therefore, we usually need to determine whether the related single-party object is obtained, that is, whether the object is null.
So what causes such a situation? You can learn more in the video demonstration.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.