Logic bug of An ADO. NET Entity Framework

Source: Internet
Author: User

Contact me these daysADO. NET Entity Framework suddenly found a strange bug.

First, let's look at this directory structure:


I saved the EDM model to a directory named "A", edited the model, and set its namespace to "commondbmodel ":

Open commondbmodel. Designer. CS to view the generatedCode:

 

The above namespace is actually "A", not the "commondbmodel" I set ".

This namespace is apparently consistent with the directory name, so I modified the directory name "commondbmodel ":

Modify and save the model in symbolic form to refresh the generated code and view the generated code:

 

It turns into "commondbmodel ".

That is to say, the namespace previously set in the property panel is invalid at all. It uses the directory name as the namespace name. I think this is not logical.

If you directly put the model under the app_code directory, the namespace attribute will take effect normally.

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.