简体   繁体   中英

VS auto-generated class error: Type already contains definition

I have the following class generated with Visual Studio's "Paste JSON as classes":

namespace MTGCollectionTracker
{

    public class ScryfallCardSource
    {
        //long chunk of code
        public string name { get; set; }
        public string lang { get; set; }
        public string released_at { get; set; }
        public string uri { get; set; }
        //another long chunk of code
    }
}

I get two "Type already contains definition" errors for set_name and set_uri . Why do I get them and how do I fix them?

  1. Why do you get them: You have two class members that have the same name

  2. How do you fix them: Rename one of them

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM