The C # compiler in Visual Studio will error if you add a get_[property name that is already included in the class when parsing the property name, Microsoft Big Brother what the hell is this?

Source: Internet
Author: User

Suppose you create a new class copy of the following code in our VS environment, it looks as if everything is fine.

1 usingSystem;2 usingSystem.Collections.Generic;3 usingSystem.ComponentModel.DataAnnotations;4 usingSystem.ComponentModel.DataAnnotations.Schema;5 usingSystem.Linq;6 usingSystem.Text;7 usingSystem.Threading.Tasks;8 9 namespaceYaou. Data.domainmodelsTen { One[Table ("coupon_setting")] A      Public classcoupon_setting -     { - [Key] the [Databasegenerated (databasegeneratedoption.identity)] -          Public intID {Get;Set; } -  -[MaxLength ( -)] +          Public stringTitle {Get;Set; } -  +          PublicDateTime get_started_on {Get;Set; } A  at          PublicDateTime get_end_on {Get;Set; } -  - [DataType (datatype.date)] -          PublicDateTime started_on {Get;Set; } -  - [DataType (datatype.date)] in          PublicDateTime end_on {Get;Set; } -  to          Public VirtualCategory Category {Get;Set; } +  -          Public intAmount {Get;Set; } the     } *}

Create two attributes at the same time one for get_started_on one for started_on;

Immediately error.


The error CS0102 type "Coupon_setting" already contains the definition of "get_started_on".

Are you kidding me, Big Brother Microsoft?

We look forward to your participation and give the answer.

The C # compiler in Visual Studio will error if you add a get_[property name that is already included in the class when parsing the property name, Microsoft Big Brother what the hell is this?

Related Article

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.