<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mark Pelf</title>
    <description>The latest articles on DEV Community by Mark Pelf (@markpelf).</description>
    <link>https://dev.to/markpelf</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2084094%2F3fcad50d-da73-47e4-8872-590189b69754.jpg</url>
      <title>DEV Community: Mark Pelf</title>
      <link>https://dev.to/markpelf</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/markpelf"/>
    <language>en</language>
    <item>
      <title>GitHub Copilot Agent looks promising – Part3 (June 2025)</title>
      <dc:creator>Mark Pelf</dc:creator>
      <pubDate>Thu, 12 Jun 2025 08:13:29 +0000</pubDate>
      <link>https://dev.to/markpelf/github-copilot-agent-looks-promising-part3-june-2025-299b</link>
      <guid>https://dev.to/markpelf/github-copilot-agent-looks-promising-part3-june-2025-299b</guid>
      <description>&lt;p&gt;GitHub Copilot Agent, as of June 2025, looks much more capable than it did 2 months ago.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Abstract: After the appearance of the GitHub Copilot Agent, I decided to try it on my real-life ASP.NET8 project of 123.000 SLOC. I tried some limited-scope tasks, and the initial results are much better than my GitHub Copilot tests two months ago.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1 GitHub Copilot in VS2022
&lt;/h2&gt;

&lt;p&gt;I am working on the development of .NET8/C#/ASP.NET8/EF8  application, which is now around 123.000 lines of code (SLOC), out of which 50.000 is EF-database-first model, in Visual Studio 2022.&lt;/p&gt;

&lt;p&gt;I have a subscription to &lt;strong&gt;&lt;em&gt;GitHub Copilot Pro +&lt;/em&gt;&lt;/strong&gt; license. So far, that AI tool has been good for limited-scope tasks. I wanted to try the new GitHub Copilot Agent mode. Below are notes from my regular work.&lt;/p&gt;

&lt;p&gt;Environment is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Visual Studio 2022, 17.14.5&lt;/li&gt;
&lt;li&gt;GitHub Copilot (GHC). License Copilot Pro+&lt;/li&gt;
&lt;li&gt;Agent mode, GPT-4o, GPT-4.1, Claude 3.7 Sonnet&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2 Anecdotal Experience with Real ASP.NET8 project
&lt;/h2&gt;

&lt;p&gt;The task is described in “Part2” of this series. Here is just my further analysis.&lt;/p&gt;

&lt;h2&gt;
  
  
  3 Analysis – Impressions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  3.1 Human reviewing GHC-generated code in the previous task (regarding Part2)
&lt;/h3&gt;

&lt;p&gt;I was looking very carefully at the generated code. Here are my findings.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First, it is clean of syntax errors (C#) or similar nonsense, like extra brackets, which was a big problem 3 months ago.&lt;/li&gt;
&lt;li&gt;Not a single time I saw “hallucinated C# class property or member” that I saw 3 months ago in quantity that made generated code unusable because of re-work needed to fix all that garbage. This time is much, much smarter, I would say not a single level of quality up, but several levels of quality up. I do not know how, but that was a big problem, and it looked like GHC was trying to “guess out” properties names, instead of looking into the EF model. This time, it looked into other files of code of the project (no other way to find the right property names) and did the comparison/match. 3 months ago, I was thinking that LLMs are unusable for coding because of the hallucination problem, but they solved that. Even the fact that my DB table names are partly English, partly German, was not a problem; it figured that Contract==Vertrag, Account==Konto, etc. It is not that simple for a machine; English and German names are mixed in DB table names, C# class names, method parameters, etc.&lt;/li&gt;
&lt;li&gt;I told it to copy ALL COMMENTS, but it didn’t. It copied most of it. I am human and I need those comments, because 3 months later, when I look into the code, I do not remember proper API usage, so I leave comments on why and how it was invoked. I reviewed the code and copied the comments I like myself. It is not a big problem, but I noticed, GHC does not follow the given instructions strictly, it is “like a human coworker”, it does most of it, but changes a bit to its liking.&lt;/li&gt;
&lt;li&gt;Because the task was to make new code based on the original template, it looks simple. But it is not for the machine. So, GHC changes are right, it looks like it was able to “understand” the code and figure out where it needs to change the template, and where it doesn't. That is not simple at all, but it figured it right. There are many technologies involved, MVC Razor/HTML,CSS/JS/jQuery/Databable.net in 370 lines of code (.cshtml), and to figure out which string belongs to which library is no easy task for a machine. Simply, as far as I can see, GHC figured it all out and got it right.&lt;/li&gt;
&lt;li&gt;I didn’t ask for it, but during copying from the original template, it removed some dead JS code. I probably copied some JS functions, but later I did not need them, so they stayed there. OK, the new file is faster because it will need to load 15 lines of JS code less in the browser, but that is not the point. The point is, GHC “knows what is doing”, and that is sometimes what you want from a coworker, not just to do the task, but to fix little things-problems it notices during work, without explicit request for that.&lt;/li&gt;
&lt;li&gt;There is one subtle thing I am doing in my ASP.NET8 View-Component and GHC didn’t get it at first, and I needed to ask for several commands to finally do it, but once it figured it out, it figured it out better than I expected. So, in a view file (.cshtml) I am using a boolean flag ((Model?.IsSelectable), to make from one component actually 2 components, one editable and one read-only. Based on that flag, I show or hide some HTML/Datatables.net elements in .cshtml file. It is kind of tricky, because you have a mixture of MVC Razor/HTML/ CSS/JS/ jQuery/Databable.net languages. It looks like GHC didn’t get it in the first iteration/command. Then in the second, it copied HTML that is generated only in the default case Model?.IsSelectable==false. In the third iteration/command, I told it to include that flag, and it did with all the proper syntax. I still didn’t run it, but by reviewing the file visually, it looks like all the HTML/JS syntax is OK. But it did even more. I am using a boolean flag ((Model?.IsSelectable) in the original template just to show/hide visual HTML elements, and load ALL the JS code anyway. What GHC thing did is, it got the idea, why load all the JS code, when you do not need the “selectable part of JS code” if the component is read-only. And based on its own initiative, it implemented the same Boolean flag to include/exclude parts of JS code. Yes, I agree, that is an improvement, not big since that is maybe 100 lines of JS, but I did not care about that because I was just happy to get the component working. I do not know how GHC works from inside, but from my point of view, it appears that GHC “understands” that the .cshtml view file is about to be loaded into a browser, and for performance reasons, optimizations are possible. And on its own initiative, implemented optimization, and as far as I can see, looks like it all syntax and functionality is fine. It is a small performance improvement ( 100 lines of JS), but the big thing is “GHC looks like it knows what it is doing”.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4 Conclusion
&lt;/h2&gt;

&lt;p&gt;Again, this was &lt;strong&gt;&lt;em&gt;a small task, and this was still a task carefully chosen for GHC&lt;/em&gt;&lt;/strong&gt;, in the sense that it is template-based and component-separated from the main code. It only needed to clone the code and adapt it from the Account entity to the Contract entity. But before, GHC would fail even in such “Gen-AI favorable scenarios”.&lt;/p&gt;

&lt;p&gt;But, compared to several months ago, this “GitHub Copilot Agent” looks much, much smarter. It actually &lt;strong&gt;&lt;em&gt;feels (on this smaller task, based on produced results) a bit like human coworker, does not figure it right away, so you need to explain details more, it does quality job, but it does not do exactly what you asked and does some things his own way, and sometimes is more clever that you think it will be&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Based on modifications GHC made to the code of my original template C#/cshtml 4 files, I was &lt;strong&gt;&lt;em&gt;able to follow “how GHC is thinking”, and it does think like a good programmer&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;To be continued…&lt;/p&gt;

</description>
      <category>ai</category>
      <category>githubcopilot</category>
    </item>
    <item>
      <title>GitHub Copilot Agent looks promising – Part2 (June 2025)</title>
      <dc:creator>Mark Pelf</dc:creator>
      <pubDate>Thu, 12 Jun 2025 08:10:55 +0000</pubDate>
      <link>https://dev.to/markpelf/-github-copilot-agent-looks-promising-part2-june-2025-1igf</link>
      <guid>https://dev.to/markpelf/-github-copilot-agent-looks-promising-part2-june-2025-1igf</guid>
      <description>&lt;p&gt;GitHub Copilot Agent, as of June 2025, looks much more capable than it did 2 months ago.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Abstract: After the appearance of the GitHub Copilot Agent, I decided to try it on my real-life ASP.NET8 project of 123.000 SLOC. I tried some limited-scope tasks, and the initial results are much better than my GitHub Copilot tests two months ago.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1 GitHub Copilot in VS2022
&lt;/h2&gt;

&lt;p&gt;I am working on the development of .NET8/C#/ASP.NET8/EF8  application, which is now around 123.000 lines of code (SLOC), out of which 50.000 is EF-database-first model, in Visual Studio 2022.&lt;/p&gt;

&lt;p&gt;I have a subscription to &lt;strong&gt;&lt;em&gt;GitHub Copilot Pro +&lt;/em&gt;&lt;/strong&gt; license. So far, that AI tool has been good for limited-scope tasks. I wanted to try the new GitHub Copilot Agent mode. Below are notes from my regular work.&lt;/p&gt;

&lt;h2&gt;
  
  
  2 Anecdotal Experience with Real ASP.NET8 project
&lt;/h2&gt;

&lt;p&gt;Environment is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Visual Studio 2022, 17.14.4&lt;/li&gt;
&lt;li&gt;GitHub Copilot (GHC). License Copilot Pro+&lt;/li&gt;
&lt;li&gt;Agent mode, GPT-4o, GPT-4.1, Claude 3.7 Sonnet&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The task is:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The task is to create a similar View-Component based existing.&lt;/li&gt;
&lt;li&gt;Context is WebApp (.dll) in this moment is ~66.000 SLOC , different technologies, C#, JavaScript, jQuery, Bootstrap, HTML, CSS, ASP.NET8, MVC, Razor.&lt;/li&gt;
&lt;li&gt;The task to GHC is to create new View-Component based on the existing template. It is 4 files in different technologies. Still, it is pattern-based, practically just Contract and Account need to be switched. It is a component, so it is independent from the main app code, and it limited scope.&lt;/li&gt;
&lt;li&gt;Component uses AJAX, so the Controller method for the component needs to be created too&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2.1 Create a new AJAX method in ASP.NET MVC controller based on the existing
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;That is 80 lines of C# code method, just is referencing DataAccessLayer dll TBServerUI.Data. It is pattern-based; it should be no problem.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  2.1.1 GHC (GPT-4o)
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;(Run1-GHC (GPT-4o) )&lt;/em&gt;&lt;/strong&gt; My request &lt;strong&gt;&lt;em&gt;COMMAND&lt;/em&gt;&lt;/strong&gt; to GHC (GPT-4o) was :

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;Based on method AccountsListForContractDT_AJAX in file #AccountsController.cs, create a similar method where Contract and Account roles are switched, called ContractsListForAccountDT_AJAX . Context is TBServerUI.WebApp project. In implementation, you will need to use Contracts_ContractsForAccountListDT from TBServerUI.Data project.&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;It worked a 3 minutes, it added a method, it tried to build, it built. I looked into it. IT IS GOOD. It was pattern-based, but it did exactly what I would do manually. Just put it in AccountController, I want it in ContractController.&lt;/li&gt;

&lt;li&gt;So, I asked to move that method to the other controller class, and it did. It was built again to verify that it all builds.&lt;/li&gt;

&lt;li&gt;It looks GHC has some problems if VS2022 project/solution is not opened in the proper folder/view/tab. It couldn’t find the C# file. So I helped it a bit, by observing GHC-Chat-Window, which is practically a Log of what is doing, and when it was not able to find some file, I navigated VS2022 to that file/class. Then it was unstuck and continued to work.&lt;/li&gt;

&lt;li&gt;&lt;strong&gt;I AM IMPRESSED. IT DOES FEEL AS IF YOU HAVE A COMPETENT COOWORKER THAT GETS INSTRUCTIONS FROM YOU AND YOU CAN DELEGATE WORK TO HIM/HER.&lt;/strong&gt;&lt;/li&gt;

&lt;li&gt;And commands/instructions I gave to GHC are quite normal, as I would give to some coworker, not too much of “prompt engineering pseudo science tricks” were needed. Quite a natural language. OK, I admit, I was skeptical in the past, but this looks like real AI.&lt;/li&gt;

&lt;li&gt;The fact that GHC automates VS2022 has a big psychological effect… really looks like someone else has overtaken control of your dev tools.&lt;/li&gt;

&lt;li&gt;I am using Git, and that is my line of defense; there, I observe every change made to project files and review each one before accepting it. I kind of do not trust AI messing with my project, without me having firm control of every line that is about to be changed.&lt;/li&gt;

&lt;li&gt;I do read AI-generated code, but in the past, it happened that I overlooked some small change AI added, and that created problems later. What happened before, AI-generated code in case of method failure returned an empty object from the default constructor, and I usually return null in case of failure, so it messed with logic in upper invoking methods. I just didn’t see such a small deviation in code created by AI. That is why I say, be careful, AI follows some textbox conventions (from who knows which author), not your project conventions.&lt;/li&gt;

&lt;li&gt;In this case, I read 80 lines of code, and it looks fine, but I am not a compiler, just a human, maybe some small error is somewhere.
&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh4gphz42t32k2uyp4ud8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh4gphz42t32k2uyp4ud8.png" width="800" height="610"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  2.2 Create a new ASP.NET View-Component based on template (4 files)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;This is a bit more tricky task. It is still template-based, but involves 4 files and several different technologies.&lt;/li&gt;
&lt;li&gt;Still, the component is a limited-scope task.&lt;/li&gt;
&lt;li&gt;On the other hand, many ASP.NET developers do not know or use View Components.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  2.2.1 GHC (GPT-4o)
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;(Run2-GHC (GPT-4o) )&lt;/em&gt;&lt;/strong&gt; My request &lt;strong&gt;&lt;em&gt;COMMAND&lt;/em&gt;&lt;/strong&gt; to GHC (GPT-4o) was :

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;Based on View-Component AccountsForContractSelectableViewComponent in file #AccountsForContractSelectableViewComponent.cs, create a similar View-Component where Contract and Account roles are switched, called ContractsForAccountSelectableViewComponent. Context is TBServerUI.WebApp project. AccountsForContractSelectableViewComponent consists of several files: 1) AccountsForContractSelectableViewComponent.cs; 2) AccountsForContractSelectableViewComponent_Model.cs; 3) AccountsForContractSelectableViewComponent_ViewModel.cs; 4) AccountsForContractSelectable_Default.cshtml. You will need to refer to AJAX method ContractsListForAccountDT_AJAX in generated ContractsForAccountSelectable_Default.cshtml.&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;It worked for only a few minutes, and it built that work, but it was not good. It created classes for the first 3 files and embedded them into existing files. Maybe I should have told it to create new files? It didn’t create Razor view .cshtml, which is quite complicated, 477 lines of code, most JavaScript. Let’s see if we can make it do it.&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr3mtwxdmhcfzz4snu5ia.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr3mtwxdmhcfzz4snu5ia.png" width="800" height="846"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;(Run3-GHC (GPT-4o) )&lt;/em&gt;&lt;/strong&gt; My request &lt;strong&gt;&lt;em&gt;COMMAND&lt;/em&gt;&lt;/strong&gt; to GHC (GPT-4o) was :

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Move classes ContractsForAccountSelectableViewComponent_Model, ContractsForAccountSelectableViewComponent_ViewModel, ContractsForAccountSelectableViewComponent into their own files. File locations are same as model files on which they were generated&lt;/em&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;It did it right, and now it looks better. Maybe complex tasks need to be broken into subtasks.&lt;/li&gt;

&lt;li&gt;I created manually view file ContractsForAccountSelectable_Default.cshtml, because it looks like that is confusing GHC.&lt;/li&gt;

&lt;li&gt;This Razor view with a lot of JavaScript, so let’s see how it goes&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;&lt;em&gt;(Run4-GHC (GPT-4o) ) My request COMMAND to GHC (GPT-4o) was (***)&lt;/em&gt;&lt;/strong&gt; :

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;Based on Razor view file AccountsForContractSelectable_Default.cshtml create file ContractsForAccountSelectable_Default.cshtml as a view for component ContractsForAccountSelectableViewComponent, where Contract and Account roles are switched. In file ContractsForAccountSelectable_Default.cshtml create Datatable columns same as in ContractsList.cshtml. You will need to reference AJAX call to ContractsListForAccountDT_AJAX in controller Contracts.&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;It failed. Some errors. I will try again&lt;/li&gt;

&lt;li&gt;&lt;strong&gt;&lt;em&gt;(Run5-GHC (GPT-4o) ) My request COMMAND to GHC (GPT-4o) was (&lt;strong&gt;&lt;em&gt;)&lt;/em&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;

&lt;li&gt;This time it produced buildable code. Let’s check.&lt;/li&gt;

&lt;li&gt;It was not good at all. It used wrong model class, and created some mess with JavaScript&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;&lt;em&gt;(Run6-GHC (GPT-4o) ) My request COMMAND to GHC (GPT-4o) was (&lt;/em&gt;&lt;/strong&gt;)

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;Replace all JavaScript section in ContractsForAccountSelectable_Default.cshtml with JavaScript from AccountsForContractSelectable_Default.cshtml, and just adopt it to use Contracts_ContractsListDT_Json object&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Result was buildable, but JavaScript is not good. It shorten it a lot.&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;&lt;em&gt;(Run7-GHC (GPT-4o) ) My request COMMAND to GHC (GPT-4o) was (***)&lt;/em&gt;&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;Replace all JavaScript section in ContractsForAccountSelectable_Default.cshtml with JavaScript from AccountsForContractSelectable_Default.cshtml, and just adopt it to use Contracts_ContractsListDT_Json object. Copy also all comments in code from AccountsForContractSelectable_Default.cshtml, just adopt it to new file. Copy also sections that are triggered with Model?.IsSelectable flag when possible.&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;I have read the result, which is maybe 330 lines of JavaScript that invoke some libraries. I found a small mistake, not syntax, but it didn’t pass some parameter. VS2022 can not test syntax on JavaScript embedded in Razor, but I followed it manually, and it looks solid. Only running in the browser will show any errors. But it followed a pattern, improvised some things, ok- good improvisations. Made a usable base for me to modify manually. It didn’t follow my pattern for brackets; it followed textbook rules, but OK. In one place, it looks like it searched the code for the proper icon method and found the right one. It even added some smarts too, based on some flag, including/excluding some JS code. I didn’t care if a “dead code” JS method is there. It even cleaned some “dead code” methods that I initially added to the original file but later abandoned. I can actually understand what GHC wanted to do and why. It got right, which are primary keys in Accounts/Contract, and which need to be passed to other methods after selection. That is quite clever.
&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F41nx8112dx7vo2eo0kxj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F41nx8112dx7vo2eo0kxj.png" width="800" height="707"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;So, it had a problem with that Razor MVC file with a lot of JavaScript, and needed help with it. It made 3 easy files right away, and it needed help with the 4&lt;sup&gt;th&lt;/sup&gt; one.&lt;/li&gt;
&lt;li&gt;Very important: I did not notice garbage code in JavaScript or an obvious mess, as I saw 2 months ago.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Component needs to be tested, of course, but it looks like I got a solid codebase, with just a few modifications (~6 lines) to the generated code. And 7 prompt commands altogether.&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3 Conclusion
&lt;/h2&gt;

&lt;p&gt;This was still a task carefully chosen for GHC, in the sense that it is template-based and component-separated from the main code. It only needed to clone the code and adapt it from the Account entity to the Contract entity. But before, GHC would fail even in such “Gen-AI favorable scenarios”. So, the above shows 7 prompts that created ~500 lines of code, with small interventions from a human programmer ~6 lines of code, and some empty file creation. And commands are in practically natural language, no “pseudo-science” prompt engineering needed, I spontaneously stopped using # for marking file names, and it all worked.&lt;/p&gt;

&lt;p&gt;I have always stated that prompt engineering is “a defeat for AI” and with the advancement of AI, it will become obsolete as natural language communication will prevail.&lt;/p&gt;

&lt;p&gt;Impression*&lt;em&gt;: This version of GitHub Copilot (GHC) Agent is much, much stronger than GHC I saw a few months ago&lt;/em&gt;&lt;em&gt;. There is no mess in the code I saw 2 months ago&lt;/em&gt;&lt;em&gt;. I did not see a single hallucinated method or property, and the code is buildable, meaning syntax is proper.&lt;/em&gt;* The automation of Visual Studio 2022 (remote control by GHC) has a kind of psychological effect; you feel like someone else is present and has taken over the control of your tools. VS2022 is alive without me doing anything. It actually builds and repeats builds after errors.&lt;/p&gt;

&lt;p&gt;It does not feel like “pair programming” or “peer programming” as in marketing stories. GHC is quite passive, so it feels like an “intelligent code generator”. But it does look effort-efficient. In the above work, I made altogether 7 commands to GHC, and got some 500 lines of usable code. But you still need a human proficient programmer to filter out bad attempts and tweak code in a couple of places.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>githubcopilot</category>
    </item>
    <item>
      <title>GitHub Copilot Agent looks promising – Part1 (June 2025)</title>
      <dc:creator>Mark Pelf</dc:creator>
      <pubDate>Thu, 12 Jun 2025 08:09:16 +0000</pubDate>
      <link>https://dev.to/markpelf/github-copilot-agent-looks-promising-part1-june-2025-4cfc</link>
      <guid>https://dev.to/markpelf/github-copilot-agent-looks-promising-part1-june-2025-4cfc</guid>
      <description>&lt;p&gt;GitHub Copilot Agent, as of June 2025, looks much more capable than it did 2 months ago.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Abstract: After the appearance of the GitHub Copilot Agent, I decided to try it on my real-life ASP.NET8 project of 123.000 SLOC. I tried some limited-scope tasks, and the initial results are much better than my GitHub Copilot tests two months ago.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1 GitHub Copilot in VS2022
&lt;/h2&gt;

&lt;p&gt;I am working on the development of .NET8/C#/ASP.NET8/EF8  application, which is now around 123.000 lines of code (SLOC), out of which 50.000 is EF-database-first model, in Visual Studio 2022.  &lt;/p&gt;

&lt;p&gt;I have a subscription to &lt;strong&gt;&lt;em&gt;GitHub Copilot Pro +&lt;/em&gt;&lt;/strong&gt; license. So far, that AI tool has been good for limited-scope tasks. I wanted to try the new GitHub Copilot Agent mode. Below are notes from my regular work.  &lt;/p&gt;

&lt;h2&gt;
  
  
  2 Anecdotal Experience with Real ASP.NET8 project
&lt;/h2&gt;

&lt;p&gt;All below was done with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Visual Studio 2022, 17.14.4&lt;/li&gt;
&lt;li&gt;GitHub Copilot (GHC). License Copilot Pro+&lt;/li&gt;
&lt;li&gt;Agent mode, GPT-4o, GPT-4.1, Claude 3.7 Sonnet&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2.1 Code review of Data-Access-Layer dll
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Context is DAL layer (.dll) in this moment is ~62.000 SLOC C# (and it will grow), and out of that 50.000 is EF model (EF-database-first).&lt;/li&gt;
&lt;li&gt;That is a kind of limited scope task, clear C# code, .NET8&lt;/li&gt;
&lt;li&gt;Wanted to do a code review and see what this AI thing will do&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;(Run1-GHC (GPT-4o) )&lt;/em&gt;&lt;/strong&gt; My request &lt;strong&gt;&lt;em&gt;COMMAND&lt;/em&gt;&lt;/strong&gt; to GHC (GPT-4o) was (*)

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;I want you to do a Code Review of the project TBServerUI.Data.csproj. Identify possible software defects, and places for possible improvement of code.&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Response was quick, and it said it “read 786 files” of the project. That sounds like a good start.&lt;/li&gt;

&lt;li&gt;Replay was quite shallow. I kind of expected it would understand a bit what that .dll is doing, but it was giving me suggestions like “avoid magic number/strings” in code and “refactor method because it has too many parameters”. I do things like “shorten string to max 30 characters” before I put it in the database, and number 30 is ok there, it would just obfuscate code if I were to define const THIRTY=30 or similar garbage. I do not need that, problems I have are like 1000 times more complex, and AI gives worthless suggestions.&lt;/li&gt;

&lt;li&gt;My expectations were higher. No human can keep and memory 786 files, so my hope was that the AI machine would load it all and figure out some smarter advice, that I can not see because there are so many files. I actually know places where I made “dirty code” to make things work and left it there, to refine it later. That GHC thing didn’t see that.&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;&lt;em&gt;(Run2-GHC (GPT-4o) )&lt;/em&gt;&lt;/strong&gt; I run several times same command (&lt;em&gt;) to GHC (GPT-4o), to give it a chance to improve on response. Funny thing, I told it to do the same all over again (same command), but it did NOT read again all 786 classes, just 2 of them. I saw that before, that GHC thing is not following even full sentence instructions, it does what it wants to do.&lt;/em&gt;
&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;&lt;em&gt;(Run3-GHC (GPT-4o) )&lt;/em&gt;&lt;/strong&gt; I needed to close all open files in the editor to make it re-read all 786 files. Why do I need to do that? I was giving explicit full sentence commands () to review the whole project?&lt;/li&gt;

&lt;li&gt;Again, a pretty formal response, several pages of text, but no real substance.&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;&lt;em&gt;(Run4-GHC (GPT-4.1))&lt;/em&gt;&lt;/strong&gt; I tried same command (&lt;em&gt;) to GHC (GPT-4.1).&lt;/em&gt;
&lt;/li&gt;

&lt;li&gt;Answer is similar, formal, with suggestions if I want “deeper review, I must ask for it specifically for a certain class/file”. There are many files; why do I need to ask file by file?&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;&lt;em&gt;(Run5-GHC (Claude 3.7 Sonnet))&lt;/em&gt;&lt;/strong&gt; I tried the same command () to GHC (Claude 3.7 Sonnet).&lt;/li&gt;

&lt;li&gt;This time, it was quite slow in response. It said it read 786 files. Does slow mean it is doing something? I got a response finally.&lt;/li&gt;

&lt;li&gt;The first thing is a funny one. AI thing was reading MY OWN COMMENTS IN CODE, not the code itself, and was telling me I sound “insecure” in my comments. I do not need an opinion on my comments, I need an opinion on my code. Based on my comments, it gives an evaluation of my code. If I have put a comment like “this is a great method,” would it think it is great? So, the quote of GHC is here: &lt;strong&gt;&lt;em&gt;“The comment 'hope this is enough to prevent SQL injection' indicates uncertainty about the security measures. This should be thoroughly tested and validated&lt;/em&gt;&lt;/strong&gt;.” If my company sees that, they will need to hire a Junior guy, they are ALWAYS SURE they covered all the possibilities, no matter what code they write. Funny, GHC is giving a psychological profile of developers instead of looking into real code to see if it works.&lt;/li&gt;

&lt;li&gt;It picked on some interfaces in libraries that are marked as “obsolete”, and I use them deliberately because the Project Owner wants me to keep them all on.NET8, and I would need to upgrade the project to .NET9 to use the latest interfaces. GHC is quite shallow here, such comments would mislead someone into the project that can not be compiled.&lt;/li&gt;

&lt;li&gt;OK, it found some properties that it sees as mutable, I do only reads from them, but yes, they are not marked as read-only, so in multithreading, there could be problems… I didn’t see that before…&lt;/li&gt;

&lt;li&gt;Some other minor comments… nothing I find useful… refactor this or that, split interface into several smaller interfaces, all cosmetic code changes.&lt;/li&gt;

&lt;li&gt;Ok. Enough of code review for now.&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8m3zkq1i4fgx2ramsj79.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8m3zkq1i4fgx2ramsj79.png" width="800" height="323"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  2.2 Create a new method based on the existing
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The task is to create a similar method based on a 200-line C# template method&lt;/li&gt;
&lt;li&gt;The task to GHC was to create a DB access method based on a similar one, just to reverse Contract-Account roles. The original method is ~200 lines of C# code, but it uses EF-Core, LINQ, and some Data library classes and references some DTO classes. Still, it is quite easy, I would need 15 min, but I understand the DAL layer in this moment is ~62.000 SLOC (and it will grow), and out of that 50.000 is EF model (EF-database-first).&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  2.2.1 GHC (GPT-4o)
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;(Run1-GHC (GPT-4o) )&lt;/em&gt;&lt;/strong&gt; My request &lt;strong&gt;&lt;em&gt;COMMAND&lt;/em&gt;&lt;/strong&gt; to GHC (GPT-4o) was (**):

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;Based on method Accounts_AccountsForContractListDT in file #DbWork.Contracts.cs, create a similar method where Contract and Account roles are switched, called Contracts_ContractsForAccountListDT. Context is TBServerUI.Data project.&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;So, it was running for like full 4 minutes doing something, automated VS2022, source code window opened, it was entering text, then tried a build, and the report shows no errors in the second build. Looked impressive, that automation of VS2022 made me first time feel there is somebody else present. Let us see what it made.&lt;/li&gt;

&lt;li&gt;It created a method. Added to proper file (not the same file where original &lt;strong&gt;&lt;em&gt;Accounts_AccountsForContractListDT (DbWork.Accounts.cs)&lt;/em&gt;&lt;/strong&gt; method is, but to DbWork.Contracts.cs.&lt;/li&gt;

&lt;li&gt;I was looking into the generated method content. It looks pretty good. The truth is I am doing a lot of work with the proper naming of all the classes in the project, so it could find the DTO just by naming conventions. But still, it found the right DTO classes. I am not a machine/compiler, but the method looks good to me. I can not really see all the details, if they are completely right.&lt;/li&gt;

&lt;li&gt;One of the problems I noticed before with Gen-AI is that they produce a lot of text, and it is quite difficult and time-consuming to review it properly. It happened in the past, I was accepting Gen-AI code, but there was a small bug hidden that I did not notice.&lt;/li&gt;

&lt;li&gt;So, key LINQ/EF queries looked fine. It even figured German names from the database, it is KONTO, VERTRAG table, not ACCOUNTS, CONTRACTS. And primary keys are KONTO_NR, VERTRAG_NR, etc. It figured it, and it looks like it is doing the right filtering.&lt;/li&gt;

&lt;li&gt;It added some processing to the result that is specific for Contracts, and is not symmetric to the Accounts method I instructed it. It looks like it is quite clever, it looks like it found it somewhere in the project source code and inserted it here. Yes, the guess is right, it should be there. That is my code that is copied here, just even I can not fully review (do not remember) if all details are fine. This AI thing, of course, does not know what “Ebics Users” is, but it just saw the property “numberEbicsUsers” and it hacked it, found somewhere in the project method that calculates that property and assigned it. And the guess was good.&lt;/li&gt;

&lt;li&gt;There is one Boolean flag that stayed unused, but that is a minor thing compared to all the other. I will set that flag.&lt;/li&gt;

&lt;li&gt;&lt;strong&gt;So, looks like a good job. It compiles. No hallucinated properties/methods this time. Much better than what I have seen before for GHC.&lt;/strong&gt;&lt;/li&gt;

&lt;li&gt;Let’s see what other LLMs will do.&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  2.2.2 GHC (GPT-4.1)
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;(Run2-GHC (GPT-4.1) )&lt;/em&gt;&lt;/strong&gt; My request &lt;strong&gt;&lt;em&gt;COMMAND&lt;/em&gt;&lt;/strong&gt; to GHC (GPT-4.1) was (**) again.&lt;/li&gt;
&lt;li&gt;It started to work on something. Then, in the chat window, it was loading like 6 files from the project. Then it said it is going to load 786 files of the project. Then it breaks, with an error in VS2022:

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;{"error":{"message":"prompt token count of 64602 exceeds the limit of 64000","code":"model_max_prompt_tokens_exceeded"}}&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;It failed. Some GHC error. Let’s restart VS2022 and try all again.&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;&lt;em&gt;(Run3-GHC (GPT-4.1) )&lt;/em&gt;&lt;/strong&gt; My request &lt;strong&gt;&lt;em&gt;COMMAND&lt;/em&gt;&lt;/strong&gt; to GHC (GPT-4.1) was (**) again.&lt;/li&gt;

&lt;li&gt;It was running for a while. From the Chat dialog ( which actually serves as a Log window) it can be seen that it loaded a limited number of files. It was stuck, it couldn’t find/load some model C# file. It tried several times and failed. Then I manually navigated (actually, I was just checking if the file was there) and it continued.&lt;/li&gt;

&lt;li&gt;Then it proposed a plan of changes and stopped. I was looking, but nothing was generated. So I just typed: “continue with your plan,” and it continued and did it. And it created code, and built it, and the build was successful.&lt;/li&gt;

&lt;li&gt;I looked into the solution, and it looked the same as above by GPT-4o. At least the key parts that I checked are the same. All comments from above apply here too.
&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9k162awuxz5whxpv62lw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9k162awuxz5whxpv62lw.png" width="658" height="782"&gt;&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpqxltff0lbs9mym5xsoz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpqxltff0lbs9mym5xsoz.png" width="659" height="781"&gt;&lt;/a&gt;  &lt;/p&gt;

&lt;h4&gt;
  
  
  2.2.3 GHC (&lt;strong&gt;Claude 3.7 Sonnet&lt;/strong&gt;)
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;(Run4-GHC (Claude 3.7 Sonnet) )&lt;/em&gt;&lt;/strong&gt; My request &lt;strong&gt;&lt;em&gt;COMMAND&lt;/em&gt;&lt;/strong&gt; to GHC (Claude 3.7 Sonnet) was (**) again.&lt;/li&gt;
&lt;li&gt;Execution failed after 5 minutes with message:

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;{"error":{"message":"prompt token count of 95998 exceeds the limit of 90000","code":"model_max_prompt_tokens_exceeded"}}&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;It failed. Let’s restart VS2022 and try all again.&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;&lt;em&gt;(Run5-GHC (Claude 3.7 Sonnet) )&lt;/em&gt;&lt;/strong&gt; My request &lt;strong&gt;&lt;em&gt;COMMAND&lt;/em&gt;&lt;/strong&gt; to GHC (Claude 3.7 Sonnet) was (**) again.&lt;/li&gt;

&lt;li&gt;Execution failed after 5 minutes. The error was different:

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;[Conversations Information] [CopilotClient] Copilot Internal User response: Conversations.Abstractions.Auth.CopilotUserData; [Conversations Information] [CopilotModels] Environment variable COPILOT_USE_DEFAULTPROXY found: False; [Conversations Information] Copilot auth status: OK. Copilot badge status: Active&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;I checked. My internet connection looked fine. On this machine I have 190Mbps/19Mbps.&lt;/li&gt;

&lt;li&gt;Let’s restart VS2022 and try all again.&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;&lt;em&gt;(Run6-GHC (Claude 3.7 Sonnet) )&lt;/em&gt;&lt;/strong&gt; My request &lt;strong&gt;&lt;em&gt;COMMAND&lt;/em&gt;&lt;/strong&gt; to GHC (Claude 3.7 Sonnet) was (**) again.&lt;/li&gt;

&lt;li&gt;Execution failed after 10 minutes. Error was:

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;[PersistedCopilotSessionRepository Error] Error saving updated session: MessagePack.MessagePackSerializationException: Failed to serialize Microsoft.VisualStudio.Copilot.CopilotInteraction value; [Conversations Information] [CopilotClient] Copilot Internal User response: Conversations.Abstractions.Auth.CopilotUserData; [Conversations Information] [CopilotModels] Environment variable COPILOT_USE_DEFAULTPROXY found: False; [Conversations Information] Copilot auth status: OK. Copilot badge status: Active&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcot9lczi0ee0lfa0po8v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcot9lczi0ee0lfa0po8v.png" width="798" height="901"&gt;&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk0p72019oymllpouoovb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk0p72019oymllpouoovb.png" width="800" height="693"&gt;&lt;/a&gt;  &lt;/p&gt;

&lt;h2&gt;
  
  
  3 Conclusion
&lt;/h2&gt;

&lt;p&gt;These are, of course, limited tests involving the generation of a single method based on a clear pattern. However, even with such straightforward tasks, GHC previously either failed entirely or produced code that required substantial manual correction.&lt;/p&gt;

&lt;p&gt;So far, the improvements are dramatic compared to two months ago. Back then, the code generated by GHC often wouldn’t compile right away and suffered from odd syntax issues, like misplaced or mismatched brackets around code blocks. Even worse, it frequently included hallucinated method or property names that didn’t exist in the project. It did not look like a meaningful work process.&lt;/p&gt;

&lt;p&gt;Now, the generated code has correct syntax, compiles right away, and the referred properties/methods do exist. This time, it actually starts to look like a proper work process. GHC Agent automates VS2022, so on a psychological level, it actually looks like someone else has overtaken control of your dev tools.&lt;/p&gt;

&lt;p&gt;I'll keep testing it/working with more complex scenarios, but the &lt;strong&gt;&lt;em&gt;GitHub Copilot Agent&lt;/em&gt;&lt;/strong&gt; mode already feels like a significant step forward in quality.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>githubcopilot</category>
    </item>
    <item>
      <title>Reusing Spare HDDs and SSDs with USB Disk Enclosures</title>
      <dc:creator>Mark Pelf</dc:creator>
      <pubDate>Tue, 22 Apr 2025 15:45:38 +0000</pubDate>
      <link>https://dev.to/markpelf/reusing-spare-hdds-and-ssds-with-usb-disk-enclosures-1mbj</link>
      <guid>https://dev.to/markpelf/reusing-spare-hdds-and-ssds-with-usb-disk-enclosures-1mbj</guid>
      <description>&lt;p&gt;This article demonstrates how to give old, unused hard drives and solid-state drives new life by using USB external enclosures.   &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Abstract: We show how spare HDDs and SSDs from old laptops or upgrades can be reused as external storage through affordable USB enclosures.&lt;/em&gt;&lt;/strong&gt;   &lt;/p&gt;

&lt;h2&gt;
  
  
  1 Repurposing Spare HDDs and SSDs
&lt;/h2&gt;

&lt;p&gt;After upgrading several laptops, I was left with a handful of spare HDDs and SSDs. Rather than letting them sit idle, I decided to repurpose them as external storage devices using USB enclosures. &lt;/p&gt;

&lt;h3&gt;
  
  
  1.1 Magnetic Media Degradation Over Time
&lt;/h3&gt;

&lt;p&gt;It’s well known that all magnetic media—including tapes, HDDs, and SSDs—deteriorate over time. While this process can take years or even decades, SSDs are particularly vulnerable: if left unpowered, some can begin to lose data within just six months ([1]). This makes traditional HDDs a more reliable option for long-term storage, especially for important files like family photos.   &lt;/p&gt;

&lt;h2&gt;
  
  
  1.2 Affordable USB Enclosures
&lt;/h2&gt;

&lt;p&gt;I discovered very affordable disk enclosures on Temu.com and purchased several to use with my spare drives. The following sections detail the setup and performance of these drives in their new roles.   &lt;/p&gt;

&lt;h2&gt;
  
  
  2 Disk 1: Old laptop 512GB HDD
&lt;/h2&gt;

&lt;p&gt;Here are specifications of this upgrade:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Old laptop 512GB HDD&lt;/li&gt;
&lt;li&gt;Enclosure: USB C, 3.1 Gen2&lt;/li&gt;
&lt;li&gt;Brand: Temu.com, 6 Euros&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Pictures below describe the upgrade and speed test.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsx440vudiamdw7q9202t.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsx440vudiamdw7q9202t.jpg" width="800" height="549"&gt;&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnzlevlm647cyfe95cakw.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnzlevlm647cyfe95cakw.jpg" width="800" height="584"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhh9n7p4cgm953lqysk91.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhh9n7p4cgm953lqysk91.jpg" width="800" height="600"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj10fa36lmc9lhvmkpmwa.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj10fa36lmc9lhvmkpmwa.jpg" width="605" height="439"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  3 Disk 2: Old laptop 2TB HDD
&lt;/h2&gt;

&lt;p&gt;Here are specifications of this upgrade:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Old laptop 2TB HDD&lt;/li&gt;
&lt;li&gt;Enclosure: USB C, 3.1 Gen2&lt;/li&gt;
&lt;li&gt;Brand: Temu.com, 4 Euros&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Pictures below describe the upgrade and speed test.   &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx62jky1j79xl8p9frkb0.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx62jky1j79xl8p9frkb0.jpg" width="800" height="616"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw29huvv334amwxk6i0tb.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw29huvv334amwxk6i0tb.jpg" width="800" height="623"&gt;&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7b29wis9wbfeodc5yidm.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7b29wis9wbfeodc5yidm.jpg" width="800" height="594"&gt;&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbipyiic6ttlnfkrs6hfg.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbipyiic6ttlnfkrs6hfg.jpg" width="604" height="440"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4 Disk 3: Old laptop 512GB SSD
&lt;/h2&gt;

&lt;p&gt;Here are specifications of this upgrade:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Old laptop 512GB SSD (leftover after upgrade of laptop SSD to bigger one)&lt;/li&gt;
&lt;li&gt;Enclosure: USB C, 3.2&lt;/li&gt;
&lt;li&gt;Brand: Temu.com, 10 Euros&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Pictures below describe the upgrade and speed test.   &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F08zorv07tybmh9kzida2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F08zorv07tybmh9kzida2.jpg" width="800" height="624"&gt;&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa05i2vwaoocai8b3457c.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa05i2vwaoocai8b3457c.jpg" width="800" height="745"&gt;&lt;/a&gt;   &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb8yn9redjiriykw1prn5.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb8yn9redjiriykw1prn5.jpg" width="800" height="560"&gt;&lt;/a&gt;   &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdacgp99zeeorolxvbgpu.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdacgp99zeeorolxvbgpu.jpg" width="607" height="443"&gt;&lt;/a&gt;   &lt;/p&gt;

&lt;h2&gt;
  
  
  5 Speed comparison with Commercial External USB SSD
&lt;/h2&gt;

&lt;p&gt;For speed comparison, here is commercial product Samsung PSSD T9 2TB, USB C 3.2 Gen 2x2.   &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1eje8x3hfhmkksr9r4uc.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1eje8x3hfhmkksr9r4uc.jpg" width="800" height="704"&gt;&lt;/a&gt;   &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv34iaovir23sdt4tq70q.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv34iaovir23sdt4tq70q.jpg" width="481" height="350"&gt;&lt;/a&gt;   &lt;/p&gt;

&lt;h2&gt;
  
  
  6 Conclusion
&lt;/h2&gt;

&lt;p&gt;The USB enclosures tested offer an inexpensive and practical way to reuse old HDDs and SSDs. They are especially useful for archiving valuable data such as family photos, where long-term reliability is important.   &lt;/p&gt;

&lt;h2&gt;
  
  
  7 References
&lt;/h2&gt;

&lt;p&gt;[1] Unpowered SSD endurance investigation finds severe data loss and performance issues&lt;br&gt;&lt;br&gt;
&lt;a href="https://www.tomshardware.com/pc-components/storage/unpowered-ssd-endurance-investigation-finds-severe-data-loss-and-performance-issues-reminds-us-of-the-importance-of-refreshing-backups" rel="noopener noreferrer"&gt;https://www.tomshardware.com/pc-components/storage/unpowered-ssd-endurance-investigation-finds-severe-data-loss-and-performance-issues-reminds-us-of-the-importance-of-refreshing-backups&lt;/a&gt;&lt;/p&gt;

</description>
      <category>usb</category>
      <category>ssd</category>
      <category>hdd</category>
    </item>
    <item>
      <title>GitHub Copilot (Gen-AI) is Helpful, But Not Great (March 2025)</title>
      <dc:creator>Mark Pelf</dc:creator>
      <pubDate>Sat, 05 Apr 2025 10:53:12 +0000</pubDate>
      <link>https://dev.to/markpelf/github-copilot-gen-ai-is-helpful-but-not-great-march-2025-2llf</link>
      <guid>https://dev.to/markpelf/github-copilot-gen-ai-is-helpful-but-not-great-march-2025-2llf</guid>
      <description>&lt;p&gt;Impressions from Using GitHub Copilot Pro in Professional ASP.NET 8 / C# Development.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Abstract: Here are my thoughts after using GitHub Copilot Pro in real-world ASP.NET 8 development over the past three months. Since technology evolves rapidly, it's worth noting that these impressions are based on my experience as of March 2025..&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1 Free trial prompted me to subscribe to GitHub Copilot Pro
&lt;/h2&gt;

&lt;p&gt;I have read about AI code generators and watched some demo videos in the past, but I was not convinced that they are really production-ready.&lt;/p&gt;

&lt;p&gt;Without a reason, 3 months ago, due to a GitHub Copilot Free account being automatically activated in my &lt;strong&gt;Visual Studio 2022&lt;/strong&gt; in my ASP.NET8 project, so-called &lt;strong&gt;“ghost text”&lt;/strong&gt; code suggestions started to appear. I was shocked, &lt;strong&gt;at moments it was a brilliant&lt;/strong&gt; prediction of what I was about to write/code.&lt;/p&gt;

&lt;p&gt;For those that are unfamiliar, &lt;strong&gt;“ghost text” is GitHub Copilot (GHC) suggestions&lt;/strong&gt; presented to the user in grayed semi-transparent text that appears without reason as a prediction by AI of what the user is to do next. If a user likes the suggested code, just confirms it, or ignores it and does his/her work.&lt;/p&gt;

&lt;p&gt;In a few days, I decided to subscribe to the full &lt;strong&gt;&lt;em&gt;GitHub Copilot PRO&lt;/em&gt;&lt;/strong&gt; subscription to check out that tool.&lt;/p&gt;

&lt;h2&gt;
  
  
  2 Preparing for GitHub Copilot - AI usage
&lt;/h2&gt;

&lt;h3&gt;
  
  
  2.1 Training
&lt;/h3&gt;

&lt;p&gt;I always take tools seriously, so I read manuals in advance, to be able to use tools to their full potential and be aware of limitations.&lt;/p&gt;

&lt;p&gt;I have listened for about 10 hours of videos on GitHub Copilot, topics like “prompt engineering”, “what is context”, etc. I made my own “cheat sheet” of prompt commands and shortcut keys. After 10 hours of training, I was ready to try it in my real-life professional coding in ASP.NET 8/C#/Bootstrap/EF8/JS environment.&lt;/p&gt;

&lt;h3&gt;
  
  
  2.2 Prompt Engineering in general
&lt;/h3&gt;

&lt;p&gt;In my opinion, &lt;strong&gt;“Prompt Engineering” is a defeat for AI&lt;/strong&gt;. One of the first definitions I heard of AI systems 20 years ago was that AI would be achieved when we would be able to talk to computer systems in natural language.&lt;/p&gt;

&lt;p&gt;Now they tell you that GHC is an AI system, but you can not really talk to it in “natural language”; you need to use “prompt engineering”, which is really &lt;strong&gt;a sublanguage of natural language,&lt;/strong&gt; and use symbols like /, #, and @. That looks to me like some mixture of natural language and programming language. They want to sell you their AI systems they have NOW, and 5 years from now, they will probably be telling you “now we have REAL AI, no prompt engineering needed anymore”.&lt;/p&gt;

&lt;p&gt;So, the expression “prompt engineering” is coming from the period when the only way of interacting with an AI system was via a command prompt. Then, some “art” or “science” ( I would call it “pseudo-science”) in creating commands would help you make those AI systems work better. I have read several such articles, which are all “common sense”, but since the target AI system is always a “black box”, there are &lt;strong&gt;no real metrics&lt;/strong&gt; to show if one author's recommendations are better than another person's list of rules. Also, systems evolved and changed over time, so strictly speaking, those authors would need to test their recommendations against the new generation of systems again. Typically, they do not do that, but offer “common sense” rationale which is based on the perception of AI as another human intellect. And what is “common sense” for humans might not be the same for AI systems. So, I am a bit skeptical and do not fully believe all the recommendations regarding “prompt engineering” that are out there because there are no real metrics and tests against different generations of AI systems. They offer just “common sense” and anecdotal proof from a few command executions.&lt;/p&gt;

&lt;h3&gt;
  
  
  2.3. Prompt Engineering in GitHub Copilot
&lt;/h3&gt;

&lt;p&gt;So, when talking about “prompt engineering” in the context of GitHub Copilot (GHC) system, that includes not only the command line interface, but also some interaction via the Visual Studio GUI. That is basically “the user interface of GitHub Copilot”.&lt;/p&gt;

&lt;p&gt;If one plans to use GitHub Copilot efficiently, they need to get familiar with GitHub Copilot UI. So, I did, learned all the commands like /fix, /optimize, #file1.cs, Alt+/ (invoke GitHub Copilot) etc.&lt;/p&gt;

&lt;h3&gt;
  
  
  2.4 Universe of the conversation
&lt;/h3&gt;

&lt;p&gt;When I was studying philosophy in high school many years ago, I was taught about the concept of the “Universe of the conversation”. In every conversation, it is implied, and topics in conversation typically refer current “Universe of the conversation”. It helps people understand what is being talked about, as certain topics and terms are assumed or taken for granted within that framework. That is a philosophy concept, defined many centuries ago, describing communication between humans. And its definition will not change as long as there are humans on Earth. &lt;/p&gt;

&lt;h3&gt;
  
  
  2.5 What is “context” in the AI world
&lt;/h3&gt;

&lt;p&gt;Tech companies doing AI invented the term “context,” which has a similar meaning to above mentioned philosophy term. I would like to keep terms separate, because Tech companies like to force their definitions of what the world should look like, in an effort to sell their products and shares. Also, there will probably be a definition of AI-Context-2025 and a new definition of AI-Context-2026, and so on, as technology develops.  &lt;/p&gt;

&lt;p&gt;The way I see it, the philosophy term “Universe of the conversation” will stay the same because it describes communication between humans. “Context”, on the other hand, describes communication between humans and AI-systems, and its definition will change with different technology generations of AI-systems.  &lt;/p&gt;

&lt;p&gt;So, the current context definition as of March 2025 (you can call it AI-Context-2025 ) would be: additional information the user needs to supply to the AI system for it to understand what it is required to do.   &lt;/p&gt;

&lt;h3&gt;
  
  
  2.6 What is “context” in the GitHub Copilot
&lt;/h3&gt;

&lt;p&gt;In training videos for GitHub Copilot, there has been a lot of emphasis on providing the proper “context” for your requests. To me, it looks like they ask for explicitly enumerating the files that contain relevant code. I would assume that “implied context” would be your Visual Studio project/solution, but it is not, in this moment of time, at least.&lt;/p&gt;

&lt;p&gt;Actually, there is a little GUI check-box in GitHub Copilot VS2022 you click to confirm that you want the current open document to be included in the “context” of your every request. (by the way, they call it “prompt engineering” and you are clicking GUI check boxes… maybe “GUI engineering” would be a better name 😉 ). You are also asked to enumerate relevant files by using the # prefix, like #file1.cs.&lt;/p&gt;

&lt;p&gt;So, if you want to use GitHub Copilot efficiently, there is a certain procedure on how to use it and a recommended command prompt/GUI interface for it. So, be it. I have learned/read all the instructions, and wanted to see the AI thing generate nice code for my VS2022 project.&lt;/p&gt;

&lt;p&gt;The way I get it, they want you to be very specific in your request and enumerate all the relevant files with code. I see it as similar to giving instructions to another programmer, with certain specificity. It is not difficult, compared to the numerous programming languages developers learn.&lt;/p&gt;

&lt;h2&gt;
  
  
  3 Impressions after 1st week
&lt;/h2&gt;

&lt;p&gt;GHC is just a code-assistant tool. It is not that “intelligent,” and “smart”, but it is good with repetitive tasks and can save some time typing. It is good for re-applying a pattern you have in code again and again, but it was very, very stupid in creating an original solution.&lt;/p&gt;

&lt;p&gt;It is a waste of time to “chat to it”, faster is to go to Google and read for yourself to solve some original problem.&lt;/p&gt;

&lt;p&gt;But once I create a nice pattern to solve something, it can save some typing, because it learns that pattern and reapplies it again automatically.&lt;/p&gt;

&lt;p&gt;It also tends to generate a lot of “trash code,” so a human must filter what is generated, but it is not difficult to use the “delete” button, and keep just “good snippets”.&lt;/p&gt;

&lt;p&gt;Let’s say, based on what I have seen so far, I expect it can save me 5% of the time in typing.&lt;/p&gt;

&lt;h2&gt;
  
  
  4 Impressions after 1.5 months
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;GitHub-Copilot (Gen-AI) is helpful, but not great.&lt;/strong&gt; It is useful sometimes, but only for local scope problems, cannot see the bigger picture.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sometimes it is brilliant&lt;/strong&gt;, but sometimes it makes too many mistakes, and when asked, gives answers in several pages of text, &lt;strong&gt;wasting your time,&lt;/strong&gt; especially because the &lt;strong&gt;verbose answers it gives are often off-topic&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In serious problems is useless; better to read a StackOverflow article by myself and figure it out. But sometimes, it excels and generates pretty good code for repetitive tasks.&lt;/p&gt;

&lt;p&gt;My “personal feeling” is &lt;strong&gt;“it does not know it well”&lt;/strong&gt;, it is &lt;strong&gt;“trying to guess it out&lt;/strong&gt;”, and since it is a machine with huge memory of millions of lines of code memorized, &lt;strong&gt;guesses are sometimes brilliant, sometimes off-topic&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  5 Impressions after 3 months
&lt;/h2&gt;

&lt;p&gt;GitHub Copilot (GHC) is a Gen-AI tool that is quite useful in tasks of limited scope.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GHC is sometimes brilliant.&lt;/strong&gt; So, yes, sometimes GHC is brilliant in predicting what you are about to code, and &lt;strong&gt;prompts you with “ghost text”&lt;/strong&gt; that you just need to accept into your code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GHC learns fast.&lt;/strong&gt; GHC very fast learns your style of programming (how I handle and log exceptions) better than any coworker around, and follows your style in offering you predicted “ghost text” code. I like that so much, every person around tends to have his/her own style in making logs, etc.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GHC dangerously adds its own style.&lt;/strong&gt; GHC is dangerous because it thinks it is smarter than you and will change a bit things its own way, without you noticing it. In database retrieval, in case of an exception, I was returning null. GHC prompted me with “ghost text” during coding to finish my method, and I just had a short look and accepted it. It created a bug; instead of null during an exception, it was returning an empty object, and my code elsewhere was breaking. Moral is: &lt;strong&gt;read carefully the code suggestions that it is offering to you before accepting them&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GHC can “generate code” but does not “write code”.&lt;/strong&gt; Hard to explain, but simply, GHC does not understand C# syntax well. It creates brilliant snippets of C#, but with small syntax errors. You need to &lt;strong&gt;do a separate syntax check on the code you get from GHC&lt;/strong&gt;. That is definitely not what we are accustomed to getting from machine/automated code assistants.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GHC does not understand C# syntax well.&lt;/strong&gt; First of all, it fails on nullability like string vs string? type. You need to &lt;strong&gt;check it with the compiler and polish it by yourself&lt;/strong&gt;. Not difficult, but you would expect to delegate exactly that kind of work to the machine/automated code assistants. I could only guess that maybe it mixes C#-.NET-Framework snippets with C#-.NET-Core code snippets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GHC does not understand C# syntax well.&lt;/strong&gt; It inserts code snippets into your VS2022 code project, but it messes with the open/closed curly brackets of code blocks. You need to count them by yourself and add/remove what is needed. Wastes your time and sometimes creates quite a mess. Such a &lt;strong&gt;disappointment that the generated code is not immediately compilation-ready&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GHC does not understand C# methods/properties well.&lt;/strong&gt; It offers me code that looks nice, and I accept it. But C# class object does not have that method at all. It was close, its parent object has that method, so I figured that by myself. OK, it was close, and put me on the right track. But that is what machines are supposed to be for. No human can remember all the methods from maybe 10.000 C# classes that are .NET8 API that I use in my coding. I would expect the machine to help me with that. But, no, &lt;strong&gt;even GHC is not sure what method is on which class&lt;/strong&gt;. It gives you a small homework to check that manually by yourself. &lt;strong&gt;The code it gives to you will not compile, but is “close”.&lt;/strong&gt; It looks like &lt;strong&gt;GHC hallucinates that the C# class has some method&lt;/strong&gt;, but it doesn't.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GHC does not understand C# methods/properties well.&lt;/strong&gt; I am using EF8 in my VS2022 project, and have a class Customer. I started to write some access method to the Customer DB-table, and GHC offers me GetCustomer method prediction in the “ghost text”. Concept is solid, and yes, that DB-table has a Primary Key, but it is NOT called CustomerId. It looks like &lt;strong&gt;GHC simply hallucinates that such a class property with that name should exist&lt;/strong&gt;, but it doesn’t. Predicted &lt;strong&gt;code will not compile&lt;/strong&gt;, and I need to go check into the class Customer what is exactly the exact name of the Primary Key is. It is such a disappointment that a machine/automated code assistant, &lt;strong&gt;GHC, can NOT check by itself proper property/method names&lt;/strong&gt;. It is just another class in the VS2022 project. So, the code snippet is conceptually close, but I need to &lt;strong&gt;fix manually by myself syntax errors&lt;/strong&gt;. And I had such a situation 100+ times.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GHC does not understand C# methods/properties well.&lt;/strong&gt; Impression is that GHC is shallow, it does not see much more than a few pages of code, and it is trying to “guess out” what the rest of the VS2022 project looks like.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GHC chats tend to waste your time.&lt;/strong&gt; It wastes your time with its guesses. I do not have time to read more than 2 proposals of generated code. I need to do some work. After 1-2 wrong guesses, I ignore GHC and write code by myself. I tried to “chat with GHC” and sometimes after 5-7 chat interactions, it will still be as stupid as at the beginning of the conversation. Feels like talking to a non-AI chatbot on some site selling tickets. It repeats its text all the time, and &lt;strong&gt;GHC has NO FOCUS on what you really need&lt;/strong&gt;. I tried that approach a few times, to “refine” my request in interactive chat, but it feels like talking to an idiot. I do not do that anymore, I respect and save my time and energy. I ignore GHC and do some straight coding and get results old-fashioned way. So, the conclusion is: &lt;strong&gt;I give GHC 1-2 chances to say what it has to say, then ignore it so as not to waste my time, and do coding manually&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GHC chats tend to waste your time.&lt;/strong&gt; GHC is not always a good source of information. It can be brilliant and give you better info and code samples than you hoped for. But there is &lt;strong&gt;UNCERTAINITY&lt;/strong&gt;. It can fail. If you try to get advice on some very common topic, just a bit specific to your needs, it will &lt;strong&gt;waste your time in endless chat sessions&lt;/strong&gt;. Better go to Google and find an article on Stack Overflow by yourself. GHC is a text generator, and that machine can generate a huge amount of text and code samples as a response to your question. &lt;strong&gt;I was overwhelmed with the quantity of code samples it gives you&lt;/strong&gt;. For a question you ask, it gives you text and code samples that require maybe 15 minutes to read and understand. It is almost as if it is assigning you a task: read this, and then we will talk again. And that answer after answer. That GHC thing can do that forever, to coach you how HTTP works, for example, and you ask about just one header. The problem is, it &lt;strong&gt;does not have focus&lt;/strong&gt;, &lt;strong&gt;that is not what I asked&lt;/strong&gt;. All that is &lt;strong&gt;off-topic garbage&lt;/strong&gt;. It is faster to go to Google and filter/open a couple of links to find the answer to your problem. So, the conclusion is: &lt;strong&gt;I ask GHC and read 1-2 answers, then go to Google, not to waste my time&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GHC does not follow user instructions closely.&lt;/strong&gt; It looks like GHC does not follow closely user's instructions closely, it thinks it is smarter than the user, and it &lt;strong&gt;follows instructions loosely, and gives what it thinks is better for the user&lt;/strong&gt;. So, I want HTML ASP.NET Razor form created in a certain way/style uniform across the application, but not with GHC, when I tell that, it still gives me a HTML form like from the textbook. That happened in other situations as well.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GHC feedback form is a waste of time.&lt;/strong&gt; So, software companies have a brilliant idea: they will charge for the product, but at the same time kindly ask users to participate for free in product testing. So, like many other products, some dialogs pop up asking you for your feedback. The question is whether anyone will read what you write, even if you fill the form. So many products are popping up dialogs telling you about new features and asking for 5-star evaluations of every result they produce, or even written comments. Such dialogs just clutter my workspace, and I typically have more serious things to do than to answer several questions evaluating each and every service I got. Basically, they want users in mass to help train their AI system by evaluating each answer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GHC excels in small, limited scope tasks.&lt;/strong&gt; I needed a method to Trim() all the strings in the EF class; I wanted a generic solution. I knew Reflection was the way to go, but in one line command request, GHC generated me the perfect 30-line method. Those are situations where GHC can not be beaten by humans. It would take me time to find the proper Reflection method, read some APIs, etc. This way, I got it in 20 seconds. But, &lt;strong&gt;GHC is sometimes brilliant&lt;/strong&gt;, sometimes useless even in such scenarios.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GHC fails in a bit elaborate JavaScript task.&lt;/strong&gt; So, I had a simple problem, limited scope, I needed a 10-liner method to wait until jQuery has been loaded, because I was using the “defer” attribute on jQuery loading. Looked like a perfect task for GHC. But I was shocked. &lt;strong&gt;Even after 5 attempts, GHC was producing some JS code that is doing something else&lt;/strong&gt;. It could not understand what I wanted. It was just keeping generating some snippets that are seemingly related to the problem, but in reality were useless. Like you gave a task to a Junior programmer who “claims” to know some JS, and it keeps bringing you random code samples he finds on the internet, but no one is doing the simple thing you asked for. Later, I found a snippet on StackOverflow by myself. Maybe 3 clicks on Google and I found it. &lt;strong&gt;GHC is so inferior sometimes&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GHC produces shallow C# comments.&lt;/strong&gt; I was using GHC to add some comments to my methods, and the &lt;strong&gt;produced comments are a bit shallow&lt;/strong&gt;; they do not see the big picture of what that method is trying to achieve. That is more important than line-by-line comments, now we assign this or that. It can infer from English names of methods the purposes of the method, but still not very impressive most of the time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GHC doesn’t understand C# comments well.&lt;/strong&gt; GHC, when asked to create comments for a method, can erase some lines of real code. Be careful and read carefully what is given to you as an answer. It is a big pain, you need to manually re-read the whole method, and you can not trust GHC. It looks like &lt;strong&gt;GHC does not understand syntax well, and what is a comment or not&lt;/strong&gt;, it sees just text. It happened to me, and I looked very carefully at why. I had some property set, and in the comment above, it was an old setting that I tested and commented out. &lt;strong&gt;The GHC thing erased both of them, the code and the old code commented&lt;/strong&gt;. There is a probability that I have such a thing at many places in the code. So, &lt;strong&gt;high risk of unwanted code manipulation&lt;/strong&gt; for a simple request to just add some comments. All generated commented code needs to be reviewed manually.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GHC “context” story doesn’t work as advertised.&lt;/strong&gt; It looks like there is a &lt;strong&gt;“blame” game&lt;/strong&gt; going on, with Tech companies pointing the finger at developers for failures of the AI-Gen products. Simply, &lt;strong&gt;current Gen-AI tools are not as useful as advertised in real-life situations&lt;/strong&gt;. But there is a huge “sales effort” to sell the current generation of AI tools, however imperfect they are, and to generate some revenue NOW. So, for failures and limitations, finger-pointing is going in the direction of users: “tools are great, you just do not know how to use them”. &lt;strong&gt;Tech companies say: It is the user's failure when AI tools fail, not true that current AI tools have problems.&lt;/strong&gt; One such blame game is the “context” setup for GHC.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GHC “context” story doesn’t work as advertised.&lt;/strong&gt; I am tired of reading/listening to: “you didn’t specify CONTEXT well enough”. That is just an excuse, because I did follow all the advice, and the GHC thing is still stupid and wasting my time generating useless code snippets that do not even compile, not to mention that they are off topic. I was reading about “prompt engineering” and “context”, but after my best effort, I believe that &lt;strong&gt;GHC thing is not smart enough, and can’t do the job.&lt;/strong&gt; Let’s wait for 6 months and try newer tools. It is a waste of time to try to squeeze more from GHC at this time. So, the truth is that at the present time (March 2025), GHC is quite stupid and no amount of “context info given” can help it to solve the intermediate level task.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GHC can’t solve a simple Exception.&lt;/strong&gt; I had code throwing an exception and wanted to use GHC to solve it. I positioned on the Exception in Visual Studio and invoked GHC with /FIX. It was generating text, including a recommendation to “log more to better understand code defects”, but no specific answer. It was easy, I just copied the Exception text into Google, and 3&lt;sup&gt;rd&lt;/sup&gt; link was the explanation. Not to mention that there was more text on Google on why EF9 is failing, etc. &lt;strong&gt;GHC can be so inferior in regular tasks&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GHC can’t enumerate properties from the plain C# class&lt;/strong&gt;. I was doing some LINQ and copied some objects from classes that inherit from each other. I wanted to copy all the properties that match. There were like 25 properties. I started assigning 2-3 properties and hoped for GHC to pick the pattern and insert code for the rest. No, it wouldn’t. It added a few properties out of order (which is a problem, you cannot follow which are added and which are not), then invented &lt;strong&gt;names of a few properties that do not exist (hallucinate?),&lt;/strong&gt; and it was stacked. I was trying to issue commands from the command prompt, but it misunderstood me, inserted the whole C# class in place, etc. I was trying that several times in different places, because I have many big DTOs, so such copying is often the task. &lt;strong&gt;I could not make it do it for me.&lt;/strong&gt; I got bored and &lt;strong&gt;copied properties manually by myself&lt;/strong&gt;. I was tired of giving instructions to a seemingly stupid tool. Strange that &lt;strong&gt;you cannot delegate such a simple task to GHC&lt;/strong&gt;. At times, IntelliSense is much smarter and useful than GHC.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GHC can’t do a little project of 4 C# files&lt;/strong&gt;. So, I was eager to use generative AI in my VS2022/C# project and was looking for the right opportunity. I noticed one, I was creating HTML/Razor/ASP.NET8/Bootstrap views that present some HTML tables corresponding to DB tables. It was a bit elaborate; there was breadcrumb UI inside the view, some AJAX, etc. So, I manually made one MVC Action/View for the Customers table and wanted to do completely the same for Contracts. All the same, just another DB table (corresponding to EF8 class), another EF class name with new properties. The HTML table I wanted to generate was supposed to look the same, Bootstrap style. So, typical “&lt;strong&gt;follow the PATTERN in 4 files problem”.&lt;/strong&gt; I have seen several videos emphasizing the importance of the “context”. So &lt;strong&gt;in a separate text editor, I started to write precise instructions for GitHub Copilot. I explained the task, said which file I want as a template, and marked the file name with #. I explained where the MVC model will come from, which file, etc&lt;/strong&gt;. I even spell-checked my small paragraph task for GHC. I spend some &lt;strong&gt;time preparing task instructions in a clear manner&lt;/strong&gt;. Then I supplied it to the GHC. The first form it generated did NOT follow the template I explicitly mentioned. GHC thing gave me something like a textbook-looking HTML form, not one customized in Bootstrap for my application. I asked for a new generation of code files. The second one looked like the form I already created, but out of 15 DB table properties, it created only 4. Later, I figured &lt;strong&gt;GHC can NOT read dependent files and is most of the time guessing property names&lt;/strong&gt;. It guessed right because I was disciplinarily following the same naming conventions in different EF classes, so guesses by GHC worked. I finished the file manually, by manually adding 10+ missing properties. One would &lt;strong&gt;expect that such a repetitive task could be delegated to the GHC, but no, GHC can NOT do the simple repetitive job&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GHC can’t do a little project of 4 C# files&lt;/strong&gt;. I tried again similar situation of generating some files in my VS2022/C# project based on a clear pattern-prototype file. Results are not very good, although that was the situation that was as advertised, arranged for GHC to succeed. Not complicated logic, clear name replacement needed, just a bit complicated HTML table corresponding to another DB table. But, it looks like GHC can not read EF8 properties from a 3&lt;sup&gt;rd&lt;/sup&gt; file and enumerate them to create a similar-looking HTML table. Also, it &lt;strong&gt;introduces a lot of errors into the generated file, by hallucinating about C# properties&lt;/strong&gt;. Sometimes even changes the file code without reason, so a line-by-line manual check of the generated file is needed. Also, command line chatting to GHC and asking for changes consumes time, and since the &lt;strong&gt;result is not guaranteed and contains errors&lt;/strong&gt;, in the &lt;strong&gt;end is not an efficient way of software development&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GHC can’t do a little project of 4 C# files&lt;/strong&gt;. Looking back, &lt;strong&gt;I could not be more precise regarding “context” specification&lt;/strong&gt;. Any person would understand the given written task and the context specified. I concluded that &lt;strong&gt;GHC is just not smart enough to handle a small generation of 4 files&lt;/strong&gt;, even when given a very template/pattern-oriented task. I do not want to hear anymore “proper context” stories, because I put an effort to do everything right. And it is a waste of time and effort to go and ask GHC to generate files again and again and re-read every new generated code in my VS2022/C# project. I tried that, and GHC can generate another file every time you ask, and I was tired of looking into failed attempts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GHC can’t do a little project of 4 C# files&lt;/strong&gt;. Now, when I have a similar situation to generate a new HTML view based on the template I have, &lt;strong&gt;a pattern-based task, I do not ask GHC anymore&lt;/strong&gt;. I just use a &lt;strong&gt;text editor with Find/Replace&lt;/strong&gt;, in my VS2022/C# project and it is the same amount of time and with &lt;strong&gt;more certainty&lt;/strong&gt;. Because when I use Find/Replace, I know exactly what I am getting, and GHC thing would change strings, but on its own initiative, do some changes to code sometimes, so I was never sure if it changed or erased a line or two of original template code. It is boring work, but no unexpected surprises from “smart” GHC “improving” my code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GHC makes silly Bootstrap mistakes&lt;/strong&gt;. I couldn’t remember Bootstrap class names, and I wanted to enlarge the button left and right. I asked GHC and it gave me Bootstrap class names. I applied them, and it enlarged the button top and bottom. Strange, how it can make such a mistake. I needed help exactly with all the Bootstrap CSS classes, I can not memorize them all. That is such a simple question, and GHC can not do it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  6 How to describe AI systems like GitHub Copilot
&lt;/h2&gt;

&lt;p&gt;A typical &lt;strong&gt;good definition&lt;/strong&gt; of something new consists of 2 parts: &lt;strong&gt;1) the object/concept it is similar to, and 2) how it is different from a similar object/concept&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So, when talking about Intelligent systems, people usually take humans as a reference value. They tend to say: AI-Gen system is on the level of a Junior programmer, but is better/worse in this or that.&lt;/p&gt;

&lt;p&gt;But I feel that &lt;strong&gt;for AI systems like GitHub Copilot (GHC), humans are not a good reference&lt;/strong&gt;. Humans gradually progress in their intellectual ability, they have the ability first to solve simple tasks, then more complicated and so on.&lt;/p&gt;

&lt;p&gt;I do not know much about autism, except for Hollywood movies like “Rain Man” (1988) with Tom Cruise. But if we are to compare GHC to humans, GHC looks like that autistic character from the movie. &lt;strong&gt;It can be brilliant and solve complex puzzles fast, but it can fail on a very simple task&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I would put AI systems like GHC in their own category. Their speed and huge memory, and ability to generate a huge amount of text/code fast make them incomparable to humans. That is like an idiot that has memory and mathematical ability a million times better than any human, but is still an idiot in front of the simple problem. Can you call it stupid because it does not “write code logically” but instead probably searches millions of lines of code in its memory and finds the solution to the problem faster than you?&lt;/p&gt;

&lt;h2&gt;
  
  
  7 After the experience, how am I using GitHub Copilot now
&lt;/h2&gt;

&lt;h3&gt;
  
  
  7.1 GitHub Copilot makes many C# mistakes
&lt;/h3&gt;

&lt;p&gt;Regarding code-assisted generation, GHC is such a huge &lt;strong&gt;disappointment that it can not get the C# syntax right all the time&lt;/strong&gt; and &lt;strong&gt;check the existence of C# properties/methods by itself&lt;/strong&gt;. That is definitely not what one expects to see from a machine. My feeling is that it can not reason logically at all, otherwise, it would be able to follow simple syntax rules all the time, and not create a mess with extra brackets or hallucinate about non-existing C# class methods or properties.&lt;/p&gt;

&lt;p&gt;A big shock was when GHC was asked to add comments, it deleted the active line of code because a similar line of code was commented out. That &lt;strong&gt;GHC thing does not fully understand what is “active line of code,”&lt;/strong&gt; otherwise it would not delete it. It seems it just sees text of some kind, and generates “look-alike” text. More like a child with huge memory and speed toying with code, than a “pair programmer” or a “peer programmer” as it is advertised.&lt;/p&gt;

&lt;h3&gt;
  
  
  7.2 When to use GitHub Copilot
&lt;/h3&gt;

&lt;p&gt;So, I have coding tasks to do, and &lt;strong&gt;toying with GHC was fun&lt;/strong&gt;, but now it is time to be serious. My time is limited, and my energy needs to be focused productively.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;I use “ghost test” from GHC a lot&lt;/strong&gt;, review it, and accept suggestions when I like them. It does not waste my energy, text just pops up in my VS2022/C# project, sometimes it is useful, other times it can be interesting to see what AI thinks I should do now, and it's &lt;strong&gt;a bit of fun to read AI suggestions&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;I select a part of code in one file in my VS2022/C# project, and ask for some changes or comments. GHC can understand such tasks well. I &lt;strong&gt;focus on a limited number of lines, maybe 50, and ask for suggestions&lt;/strong&gt;. Sometimes GHC suggestions are useful, but many times it can not understand what I want or produces incorrect answers. It can be lost even after 3-4 iterations of chat prompts about a simple question like which specific Bootstrap CSS class I need. But, I have it all under control, and it does not waste my time much. &lt;strong&gt;If it doesn’t know the answer well, I go to Google for the resolution.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;I use the GHC text-prompt page&lt;/strong&gt; to ask for the &lt;strong&gt;generation of snippets or small functions with clear functionality&lt;/strong&gt;. GHC is great for such tasks. Here, it can be really &lt;strong&gt;brilliant at times&lt;/strong&gt;, but sometimes it gives code snippets that are the wrong answer. &lt;strong&gt;No guarantees GHC will succeed here, but if it does, it can be brilliant&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;I no longer try bigger changes involving 3-4 files at the same time&lt;/strong&gt;, since it is a pain and effort to chat with GHC to do that. Even worse, the code generated after EACH GHC intervention needs to be re-read since one is never sure what else GHC will change. &lt;strong&gt;Using GHC for such tasks is a waste of my time.&lt;/strong&gt; Answers are at best incomplete, with many errors, like C# properties and methods that do not exist (it hallucinates?). It does not follow the given pattern closely, so I need to carefully read the generated code in my VS2022/C# project, since it can delete a line of code or add some code of its own, which is wrong in this particular case. Also, &lt;strong&gt;it is time and energy-consuming to REVIEW each answer GHC provides&lt;/strong&gt;, and that is a machine that can generate new iterations of sample code forever. And I am just &lt;strong&gt;a human, I might need maybe 10 minutes of full focus to review 300 lines of combined C#/Razor/CSS/JS, which GHC generates in 2 seconds&lt;/strong&gt;. And if I ask it to regenerate an answer, that is to give me a new proposed solution, I need to REVIEW it all again from the beginning.&lt;/li&gt;
&lt;li&gt;I was thinking, why does it hallucinate about C# properties and methods that do not exist for well-known and frequently used APIs, like related to Http context, etc.? Maybe it copied a snippet from.NET4.8 Framework, and that method is no longer there for .NET Core… But, for C# classes that are part of my VS2022 project, like EF8 classes, it looks it does not read them, it just tries to guess, there must be a Primary Key with the name CustomerId, but it is actually called differently, so I need to manually open EF8 class and copy-paste proper names of the properties.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;I do not believe in “proper context” story&lt;/strong&gt;, but believe simply that &lt;strong&gt;the tool GHC is not smart enough&lt;/strong&gt; to do serious work, and it is faster to code things straight than to endlessly chat with GHC.&lt;/li&gt;
&lt;li&gt;That “&lt;strong&gt;proper context” story is a blame game&lt;/strong&gt; by companies producing AI tools, trying to blame developers for not being able to use AI products properly. So, I have learned enough about “prompt engineering” and was making a serious effort to exploit GHC to generate code for me in my VS2022/C# project, but failed. I even planned to use GHC for tasks that suit it, to follow patterns I made (like HTML tables) and generate analogous code, but no, GHC was not good enough. Altogether, &lt;strong&gt;it generates more mess than useful code, for assigned pattern-based tasks involving 4 files&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;I returned to the old method of handling UI patterns files. For example, to create “ListOfContracts” HTML (quite advanced AJAX form) based on a very similar “ListOfCustomers” UI form. I copy and rename the file. Then I use a text editor Find-Replace to modify the form in my VS2022/C# project. It is slow, but there is a certainty in progress, and no nasty surprises with missing lines of code or added unexpected lines of code. &lt;strong&gt;I was thinking I would use GHC for such pattern-looking tasks, but it is more time-efficient and energy-efficient to code it directly manually.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;I ask GHC for help with problems, but read max 2 chat replies.&lt;/strong&gt; Its answers tend to be verbose, and if it knows it, I will get an answer in 2 attempts, which can be brilliant at times. If it does not give me a good answer in 2 attempts, I will go read Google for the same problem. That GHC thing can generate a huge amount of text and code samples and coach you on nice things, but I have a specific problem to solve, not time to chat endlessly. &lt;strong&gt;GHC has a serious focus problem, answers are frequently off-topic.&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  8 Marketing for AI products is very strong
&lt;/h2&gt;

&lt;p&gt;Marketing for AI products by tech companies is very strong, so one must put in an effort to &lt;strong&gt;stay grounded regarding the abilities of AI products&lt;/strong&gt; in the present moment of time.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Marketing is strong, because Tech companies have put money into it and want some sales and revenue NOW. Even if actual AI products are not “production-ready”, they want to &lt;strong&gt;sell them on a “vision story”.&lt;/strong&gt; Just to collect he money, marketing will create any story it needs. A good story that sells does not need to accurately reflect technical reality.&lt;/li&gt;
&lt;li&gt;They are talking about &lt;strong&gt;“pair programming”, meaning you will not work alone but in “pair”, there will be 2 of you&lt;/strong&gt; working, you and an AI-guy like GHC. Maybe in the future, but as of March 2025, I see GHC as just another code-assistance tool.&lt;/li&gt;
&lt;li&gt;They are talking about &lt;strong&gt;“peer programming”, meaning AI-guy will be equal to you in your task&lt;/strong&gt;. As of March 2025, GHC is still having big problems with C# syntax and hallucinates a bit of what some .NET Core API C# class precisely looks like. It can’t read the file in the VS2022 project that is there, but instead, &lt;strong&gt;GHC gives a human task to check syntax and finish its work&lt;/strong&gt;, while it should be the opposite; humans should delegate such boring tasks to AI tools.&lt;/li&gt;
&lt;li&gt;To make developers feel good about themselves, there are imaginative &lt;strong&gt;marketing stories&lt;/strong&gt; created about &lt;strong&gt;“piloting and aircraft” and “having a copilot”&lt;/strong&gt;. At the end of the day, you are just a guy in front of a keyboard and monitor, not in a fancy airplane traveling the world. And that GHC “AI buddy” you have (as of March 2025) looks a bit autistic to me, talks much, sometimes brilliant, sometimes stupid, and better check everything he does/says because it may sound like he knows it, but can be wrong.&lt;/li&gt;
&lt;li&gt;Many &lt;strong&gt;AI-code generators&lt;/strong&gt; are being demoed publicly in a bit of arranged, non-realistic scenarios. &lt;strong&gt;They limit the demo to a generation of a small 50-line function&lt;/strong&gt;, like “factorials” or “Fibonacci numbers”. These are well-known programming textbook tasks. AI systems excel in math and might even just pull a code sample from their huge memory of code snippets. Such demos do not show how such systems would hold up when faced with real-life 300+ files of code software development projects.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  9 Conclusion
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;GitHub Copilot (GHC) (as of March 2025) is a useful tool, and I will continue to use it in my programming.&lt;/strong&gt; It does save me a measurable amount of time by providing code snippets and suggestions sometimes.&lt;/p&gt;

&lt;p&gt;The technology level currently is that &lt;strong&gt;GitHub Copilot (GHC) can not be trusted with a bit complicated task involving several files at the same time&lt;/strong&gt;. In such scenarios, results are incomplete &lt;strong&gt;and not time-efficient compared to direct manual programming&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A serious problem is that &lt;strong&gt;GitHub Copilot (GHC) tends to hallucinate about C# methods and properties that do not exist&lt;/strong&gt;. The &lt;strong&gt;GHC-generated code does not compile right away&lt;/strong&gt;, requiring a lot of &lt;strong&gt;manual work to finish it&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Things are evolving quickly, so the notes above are already almost outdated—apparently, a new tool called GPT-4o was released just a few days ago. It seems that AI tech companies are quietly upgrading these tools in the background, making them better and better without users receiving any explicit notice.&lt;/p&gt;

&lt;p&gt;Some reports in the media suggest that large language models (LLMs) have reached their maximum and that by pure scaling, they are not becoming better. Maybe we will need to wait for some theoretical progress in AI science before we see real progress with AI tools.&lt;/p&gt;

&lt;p&gt;Version of &lt;strong&gt;GitHub Copilot from March 2025 is useful, though not as great as advertised&lt;/strong&gt;. We can expect that over time it will become better. But, still needs to be seen/verified in reality.&lt;/p&gt;

&lt;p&gt;At the end, of course, ask for a second opinion on everything that was said in the article above.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>genai</category>
      <category>githubcopilot</category>
      <category>csharp</category>
    </item>
    <item>
      <title>Portable Monitors for Laptops Are Surprisingly Affordable</title>
      <dc:creator>Mark Pelf</dc:creator>
      <pubDate>Thu, 27 Feb 2025 07:21:32 +0000</pubDate>
      <link>https://dev.to/markpelf/portable-monitors-for-laptops-are-surprisingly-affordable-37ll</link>
      <guid>https://dev.to/markpelf/portable-monitors-for-laptops-are-surprisingly-affordable-37ll</guid>
      <description>&lt;p&gt;In this review, we evaluate a 15.6-inch portable monitor with a 1920x1080 resolution, purchased for 36 Euros.   &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Abstract:  I bought a 15.6-inch portable monitor (1920x1080) from Temu.com for 36 Euros. After testing, I found the quality to be excellent, with well-thought-out design features.&lt;/strong&gt;    &lt;/p&gt;

&lt;h2&gt;
  
  
  1 Digital Nomads and Their Gadgets
&lt;/h2&gt;

&lt;p&gt;While browsing Temu.com, I came across a 15.6-inch portable monitor (1920x1080) priced at 36 Euros, including shipping. The price caught my attention, and after checking customer reviews— all of which were positive— I was intrigued. A monitor at such a low price seemed almost too good to be true. After a few days of consideration, I decided to order one. Given the price, the risk was minimal.   &lt;/p&gt;

&lt;p&gt;Product Details:   &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Brand: Shenzhen Monitor Factory&lt;/li&gt;
&lt;li&gt;Model: NC156A&lt;/li&gt;
&lt;li&gt;Specifications: 15.6" Portable Monitor, 1920x1080&lt;/li&gt;
&lt;li&gt;Price: 36 Euros (including shipping)&lt;/li&gt;
&lt;li&gt;Seller: Temu.com&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2 Package Arrival
&lt;/h2&gt;

&lt;p&gt;The monitor arrived in 13 days via mail. The packaging was excellent, comparable to well-known brands. The box included an instruction manual— though the English was sometimes unusual, it was detailed enough for setup. Interestingly, customer support uses a Hotmail.com email address.  They sent some “panda stickers” too, as a symbol of China. I see no difference in packaging compared to some brand name like HP, only the manual would be a more classy.   &lt;/p&gt;

&lt;p&gt;Here is what was in the box:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F57urxhsiuw86lyqq8o46.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F57urxhsiuw86lyqq8o46.jpg" width="800" height="460"&gt;&lt;/a&gt;   &lt;/p&gt;

&lt;h2&gt;
  
  
  3 Examining equipment and Setup
&lt;/h2&gt;

&lt;p&gt;Upon inspection, the build quality looked impressive. The monitor included two stand options:   &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A plastic standalone stand
&lt;/li&gt;
&lt;li&gt;A plastic-magnetic folder stand
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If this were a well-known brand like HP, people would praise the "great design". Now, they are saying “they copied someone else’s design”. Regardless, the design works well.    &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvdmkqw0pswyjc15pxa8u.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvdmkqw0pswyjc15pxa8u.jpg" width="800" height="566"&gt;&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;Device offers 2 ways of connecting the laptop, for new laptops, a single USB-C cable for signal and power. For older laptops, HDMI for signal, with power from a classical USB-C power adapter.   &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5hxq7yr8zx15ep72piau.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5hxq7yr8zx15ep72piau.jpg" width="800" height="533"&gt;&lt;/a&gt;   &lt;/p&gt;

&lt;p&gt;In both cases, I successfully connected the monitor to my laptop and set up dual-screen functionality on Windows 11.   &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftrnysqstkacyrjd4ynj7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftrnysqstkacyrjd4ynj7.jpg" width="800" height="431"&gt;&lt;/a&gt;    &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3wjqjhbiwlel1k26j6bb.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3wjqjhbiwlel1k26j6bb.jpg" width="800" height="463"&gt;&lt;/a&gt;   &lt;/p&gt;

&lt;h2&gt;
  
  
  4 Image Quality
&lt;/h2&gt;

&lt;p&gt;The main question: How good is the display?&lt;br&gt;&lt;br&gt;
To test this, I created a typical developer/debugging setup. The image quality is comparable to my laptop’s display, providing clear and sharp visuals for everyday tasks.    &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsk0vbjcfhqis9ii8dken.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsk0vbjcfhqis9ii8dken.jpg" width="800" height="390"&gt;&lt;/a&gt;   &lt;/p&gt;

&lt;p&gt;Given its 15.6-inch size, content appears slightly smaller but remains readable.    &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fev3maqhoqlbjrl1ivhj3.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fev3maqhoqlbjrl1ivhj3.jpg" width="800" height="515"&gt;&lt;/a&gt;   &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Folcamtf87ftgkb601hwo.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Folcamtf87ftgkb601hwo.jpg" width="800" height="510"&gt;&lt;/a&gt;   &lt;/p&gt;

&lt;h2&gt;
  
  
  5 Conclusion
&lt;/h2&gt;

&lt;p&gt;My first impressions of this monitor are very positive. If the same hardware had an HP or Dell logo and was priced around 100€, I would still consider it a great purchase.   &lt;/p&gt;

&lt;p&gt;Interestingly, there is no brand or logo on the monitor, packaging, or manual. Despite this, I’m impressed enough with the product that I would gladly look for others from the same company, even at a higher price in the future. However, it appears to be an unbranded, no-name product.   &lt;/p&gt;

&lt;p&gt;However, long-term durability remains to be seen. Only time will tell if any defects arise.   &lt;/p&gt;

</description>
      <category>laptop</category>
      <category>gadgets</category>
      <category>monitor</category>
    </item>
    <item>
      <title>Entity Framework 9 - GroupBy throwing Exception</title>
      <dc:creator>Mark Pelf</dc:creator>
      <pubDate>Tue, 18 Feb 2025 15:26:21 +0000</pubDate>
      <link>https://dev.to/markpelf/entity-framework-9-groupby-throwing-exception-4ngm</link>
      <guid>https://dev.to/markpelf/entity-framework-9-groupby-throwing-exception-4ngm</guid>
      <description>&lt;p&gt;EF9 has a bug and gives an exception "The given key 'EmptyProjectionMember' was not present in the dictionary".&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Abstract: Regular usage of EF9 sometimes throws Exception "The given key 'EmptyProjectionMember' was not present in the dictionary". It seems that is related to the bug in EF9 related to the usage of GroupBy.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1 EF 9 has a bug related to GroupBy usage
&lt;/h2&gt;

&lt;p&gt;I am using Microsoft.EntityFrameworkCore (9.0.2).&lt;br&gt;
In my code I am using GroupBy like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt; &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;query2&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;query&lt;/span&gt;
             &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;GroupBy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;contract&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt;
                             &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;contract&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;BC_NR&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;contract&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;VERTRAGS_NR&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;contract&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;VERTRAGS_TYP&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
                           &lt;span class="p"&gt;)&lt;/span&gt;
             &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;group&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;group&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Any&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
             &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;group&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt;
                     &lt;span class="k"&gt;group&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;OrderByDescending&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;contract&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;contract&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CHANGE&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;First&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
                    &lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is working fine, when I materialize the query.&lt;br&gt;
But, if I after that do some sorting, it throws Exception.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;
&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;thisWorksFine&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;iQueryableTBS_VERTRAG2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ToList&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;iQueryableTBS_VERTRAG2&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="n"&gt;iQueryableTBS_VERTRAG2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;OrderBy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;VERTRAGS_NR&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;thisThrowsException&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;iQueryableTBS_VERTRAG2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ToList&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;//Exception: The given key 'EmptyProjectionMember' was not present in the dictionary.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It can be seen in [1] that other people report the same issues. Obviously, that looks like a serious limitation of EF9, or better to say "a bug". &lt;/p&gt;

&lt;h2&gt;
  
  
  2 Some workarounds tried
&lt;/h2&gt;

&lt;p&gt;There was some unusual workaround suggested on the internet, so I wanted to try it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;
&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;thisWorksFine&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;iQueryableTBS_VERTRAG2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ToList&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;text22&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;iQueryableTBS_VERTRAG2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ToQueryString&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;iQueryableTBS_VERTRAG2&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;TBS_VERTRAG&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;FromSqlRaw&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text22&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;AsNoTracking&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;thisStillWorksFine&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;iQueryableTBS_VERTRAG2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ToList&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="n"&gt;iQueryableTBS_VERTRAG2&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="n"&gt;iQueryableTBS_VERTRAG2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;OrderBy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;VERTRAGS_NR&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;thisThrowsAnotherException&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;iQueryableTBS_VERTRAG2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ToList&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;//Exception: 'FromSql' or 'SqlQuery' was called with non-composable SQL &lt;/span&gt;
&lt;span class="c1"&gt;//and with a query composing over it. Consider calling 'AsEnumerable' &lt;/span&gt;
&lt;span class="c1"&gt;//after the method to perform the composition on the client side.&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, that workaround would not work in my case. The problem is that generated SQL in my case contains parameters definitions and the resulting query is not composable. Semicolons are the problem. Here is what my generated SQL looks like, the content of variable text22:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;DECLARE&lt;/span&gt; &lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="n"&gt;__bankClearing_0&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;DECLARE&lt;/span&gt; &lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="n"&gt;__bankClearing_1&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;-- Contracts_ContractsListDT&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t7&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;BC_NR&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t7&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;VERTRAGS_NR&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t7&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;CHANGE&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t7&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;VERTRAGS_TYP&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t7&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;AENDERUNG&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; 
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t7&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;ARCHIV_BEZ1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t7&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;ARCHIV_BEZ2&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t7&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;ARCHIV_BEZ3&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t7&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;AUSZUEGE_BIS_VORTAGE&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; 
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t7&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;BERATER_NR&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t7&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;CONTRACT_COLLECTION&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t7&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;DOCUMENT_BOX&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t7&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;ERFASST_DURCH&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; 
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t7&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;ERFOLGLOS_Z&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t7&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;ERSTELLT&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t7&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;FREIGABE1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t7&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;FREIGABE2&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t7&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;FREIGABE_DATUM_1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; 
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t7&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;FREIGABE_DATUM_2&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t7&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;GESPERRT&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t7&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;GESPERRT_BIS&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t7&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;GESPERRT_VON&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; 
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t7&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;GLAEUBIGER_ID&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t7&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;GLAEUBIGER_ID_LONG&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t7&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;KUNDEN_NR&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t7&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;LASTMOD&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;t7&lt;/span&gt;&lt;span class="p"&gt;].[&lt;/span&gt;&lt;span class="n"&gt;LAST_CALL&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; 

&lt;span class="p"&gt;......&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3 No better practical known workaround
&lt;/h2&gt;

&lt;p&gt;Article [1] mentions some other workarounds, but they didn't look practical to me. I simply coded again my EF query to avoid the usage of GroupBy, even that approach might resulted in an ugly and slower query.    &lt;/p&gt;

&lt;h2&gt;
  
  
  4 Bug in EF 9 expected to be fixed in EF 10
&lt;/h2&gt;

&lt;p&gt;In article [1] person called Shay Rojansky, a member of the Entity Framework team at Microsoft, promises that the bug will be fixed in EF 10.&lt;br&gt;
According to [2], the next planned stable release is EF Core 10.0, or just EF10, scheduled for November 2025.&lt;br&gt;
So, until then, we are forced to do workarounds.  &lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;[1] &lt;a href="https://github.com/dotnet/efcore/issues/31209" rel="noopener noreferrer"&gt;https://github.com/dotnet/efcore/issues/31209&lt;/a&gt;&lt;br&gt;&lt;br&gt;
[2] &lt;a href="https://learn.microsoft.com/en-us/ef/core/what-is-new/" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/ef/core/what-is-new/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>entityframework</category>
      <category>groupby</category>
    </item>
    <item>
      <title>Testing speed of modern External SSD backup</title>
      <dc:creator>Mark Pelf</dc:creator>
      <pubDate>Thu, 26 Dec 2024 08:44:29 +0000</pubDate>
      <link>https://dev.to/markpelf/testing-speed-of-modern-external-ssd-backup-581b</link>
      <guid>https://dev.to/markpelf/testing-speed-of-modern-external-ssd-backup-581b</guid>
      <description>&lt;p&gt;&lt;em&gt;Practically testing speed in real environment of latest technology External SSD devices (December 2024).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Abstract: I decided to practically test the speed of the latest technology in External SSD devices and compare it to previously available technologies of External USB-based backup devices. Tests are done with real-life file sets and real commercial laptops used in typical company environments.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1 Need for External USB backup in the modern business environment
&lt;/h2&gt;

&lt;p&gt;The need for &lt;strong&gt;&lt;em&gt;safe, offline backup&lt;/em&gt;&lt;/strong&gt; is driven by ransomware attacks, which I actually experienced in my company. However, there are also other kinds of needs to move files between workstations, home, and office computers, and there is a need to have backup in case of system crashes or accidental deletions.&lt;/p&gt;

&lt;p&gt;For such situations &lt;strong&gt;&lt;em&gt;External USB memory/disk devices&lt;/em&gt;&lt;/strong&gt; are irreplaceable. I like them because I can attach them to make a backup and later detach them and physically move them to a safe place, where they are definitely offline.&lt;/p&gt;

&lt;p&gt;My favorite backup method is very simple one: the usage of &lt;strong&gt;&lt;em&gt;FreeFileSync app (high-quality freeware)&lt;/em&gt;&lt;/strong&gt; that synchronizes directories. I keep all my work files on my work laptop in one root folder and sync periodically to an External USB device.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhn3l2s3inddqurobarp8.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhn3l2s3inddqurobarp8.jpg" width="797" height="531"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In compliance with company rules, I keep all my External USB devices &lt;strong&gt;&lt;em&gt;BitLocker encrypted&lt;/em&gt;&lt;/strong&gt; and secured with the password needed to access the device. There are many sensitive company and personal documents I have there, so I definitely want them safe in case memory/disk device is lost, for example during commuting to/from the office.&lt;/p&gt;

&lt;p&gt;Over the years technology for External USB memory/disk backup changed, bringing always greater transfer speeds. I bought some latest External SSD-s, so I wanted to test them.&lt;/p&gt;

&lt;h2&gt;
  
  
  2 Test scenario setup
&lt;/h2&gt;

&lt;p&gt;Here are the basic testing conditions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I will use a new Lenovo laptop with the &lt;strong&gt;&lt;em&gt;newest USB A and USB C ports&lt;/em&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;I will backup &lt;strong&gt;&lt;em&gt;real life work files, around 49.4GB&lt;/em&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;I will backup them to the External USB memory/disk device of choice&lt;/li&gt;
&lt;li&gt;External USB memory/disk device will be &lt;strong&gt;&lt;em&gt;BitLocker encrypted&lt;/em&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;I will use &lt;strong&gt;&lt;em&gt;FreeFileSync app (high-quality freeware)&lt;/em&gt;&lt;/strong&gt; that synchronizes directories as a backup solution&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here are the specs for the ports of my laptop:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxcd3lyr97hdzocaos0ef.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxcd3lyr97hdzocaos0ef.png" width="465" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is the folder with real-life docs that I will backup:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk7b6l6ju655cgqdiqqlh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk7b6l6ju655cgqdiqqlh.png" width="321" height="236"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3 Testing External 64GB USB Flash drive
&lt;/h2&gt;

&lt;p&gt;Device info:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;64GB USB Flash drive&lt;/li&gt;
&lt;li&gt;Kinston DataTraveler 3.0 USB&lt;/li&gt;
&lt;li&gt;USB-A, 3.0 (5Gbps)&lt;/li&gt;
&lt;li&gt;49.4GB transferred in 97min 15sec&lt;/li&gt;
&lt;li&gt;Average speed of backup 8.66MBps=69.26Mbps&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr3351kjmjrpjkgpkxd0g.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr3351kjmjrpjkgpkxd0g.jpg" width="600" height="365"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhl93s8ot1b1lvbtah57w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhl93s8ot1b1lvbtah57w.png" width="318" height="228"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flxxtn84nt165gs93nrwm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flxxtn84nt165gs93nrwm.png" width="342" height="159"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2sfnlck2mbx560utziuu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2sfnlck2mbx560utziuu.png" width="536" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4 Testing External 1 TB USB HDD
&lt;/h2&gt;

&lt;p&gt;Device info:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;External 1 TB USB HDD&lt;/li&gt;
&lt;li&gt;Toshiba 1 TB HDD&lt;/li&gt;
&lt;li&gt;USB-A, 3.0 (5Gbps)&lt;/li&gt;
&lt;li&gt;49.4GB transferred in 22min 28sec&lt;/li&gt;
&lt;li&gt;Average speed of backup 37.5 MBps=300 Mbps&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqgv8u97186zdarme45fu.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqgv8u97186zdarme45fu.jpg" width="600" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuaeegzakxuq4induhd2l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuaeegzakxuq4induhd2l.png" width="345" height="424"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6gqzbd7gvf0gbmzot9o8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6gqzbd7gvf0gbmzot9o8.png" width="726" height="260"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz9mi9fn0sige136x0agv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz9mi9fn0sige136x0agv.png" width="535" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5 Testing External SSD 1 TB, USB 3.2 Gen2
&lt;/h2&gt;

&lt;p&gt;Device info:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;External 1 TB SSD&lt;/li&gt;
&lt;li&gt;Samsung PSSD T7 1TB&lt;/li&gt;
&lt;li&gt;USB-C 3.2 Gen 2 (10Gbps)&lt;/li&gt;
&lt;li&gt;49.4GB transferred in 4min 3sec&lt;/li&gt;
&lt;li&gt;Average speed of backup 208 MBps=1664 Mbps&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi9i4j1a4z5n8rfj06uei.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi9i4j1a4z5n8rfj06uei.jpg" width="600" height="515"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu31g12ilva2enze608gc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu31g12ilva2enze608gc.png" width="319" height="231"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0l371np3ipa98k2oogdv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0l371np3ipa98k2oogdv.png" width="427" height="206"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqln98cx67sk4zvtttls4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqln98cx67sk4zvtttls4.png" width="536" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6 Testing External SSD 2 TB, USB 3.2 Gen2x2
&lt;/h2&gt;

&lt;p&gt;Device info:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;External 2 TB SSD&lt;/li&gt;
&lt;li&gt;Samsung PSSD T9 2TB&lt;/li&gt;
&lt;li&gt;USB-C 3.2 Gen 2x2 (20Gbps)&lt;/li&gt;
&lt;li&gt;49.4GB transferred in 2min 38sec&lt;/li&gt;
&lt;li&gt;Average speed of backup 320 MBps=2560 Mbps&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7fr0q2xay6ydhx3jxthd.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7fr0q2xay6ydhx3jxthd.jpg" width="600" height="524"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7hpbru5vsorddvebjmf0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7hpbru5vsorddvebjmf0.png" width="314" height="223"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9obqqqevpaql2tdae016.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9obqqqevpaql2tdae016.png" width="440" height="201"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2xwwyt1sno9tm2rctdd3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2xwwyt1sno9tm2rctdd3.png" width="529" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  7 Conclusion
&lt;/h2&gt;

&lt;p&gt;So, here are actual practical speeds of backup in real-world situations:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl7js14agfhj9p6va7j2r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl7js14agfhj9p6va7j2r.png" width="800" height="303"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These values are measured in these conditions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;used a new Lenovo laptop (December 2024) with the &lt;strong&gt;&lt;em&gt;newest USB A and USB C ports&lt;/em&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;backup &lt;strong&gt;&lt;em&gt;real-life work files, around 49.4GB, 41.000 files, 6.000 folders&lt;/em&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;External device &lt;strong&gt;&lt;em&gt;BitLocker encrypted&lt;/em&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;used &lt;strong&gt;&lt;em&gt;FreeFileSync app (high-quality freeware)&lt;/em&gt;&lt;/strong&gt; that synchronizes directories as a backup solution&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ssd</category>
      <category>backup</category>
      <category>usb</category>
      <category>bitlocker</category>
    </item>
    <item>
      <title>Installing additional SSD on LENOVO ThinkBook 16 G7 IML</title>
      <dc:creator>Mark Pelf</dc:creator>
      <pubDate>Thu, 19 Dec 2024 06:05:44 +0000</pubDate>
      <link>https://dev.to/markpelf/installing-additional-ssd-on-lenovo-thinkbook-16-g7-iml-3n8a</link>
      <guid>https://dev.to/markpelf/installing-additional-ssd-on-lenovo-thinkbook-16-g7-iml-3n8a</guid>
      <description>&lt;h1&gt;
  
  
  Installing additional SSD on LENOVO ThinkBook 16 G7 IML
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;Instructions on how to install additional SSD on laptop LENOVO ThinkBook 16 G7 IML.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Abstract: Laptop LENOVO ThinkBook 16 G7 IML is coming with default installed SSD 1TB, and a slot for additional SSD. Here we are showing how to install additional SSD.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1 New Lenovo laptop
&lt;/h2&gt;

&lt;p&gt;I bought a new laptop LAPTOP LENOVO ThinkBook 16 G7 IML WUXGA IPS, Ultra 7 155H, 32GB, 1TB SSD. Nice machine, 155H processor, 16 cores, 22 threads. I wanted to add an additional SSD: Samsung SSD 990 PRO 2TB.&lt;/p&gt;

&lt;h2&gt;
  
  
  2 Install steps
&lt;/h2&gt;

&lt;h3&gt;
  
  
  2.1 Remove 9 screws
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8n6vjpkfrim4ypochbyt.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8n6vjpkfrim4ypochbyt.jpg" alt="Image description" width="800" height="488"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2.2 Remove laptop back
&lt;/h3&gt;

&lt;p&gt;Remove the laptop back. Be careful, the plastic is fragile and soft.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffspje78nhtp5ftpukqvy.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffspje78nhtp5ftpukqvy.jpg" width="800" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2.3 Locate laptop modules
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4190nbszlgshyxe7tsy1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4190nbszlgshyxe7tsy1.jpg" width="800" height="528"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2.4 Disconnect battery
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffqh9kmrxe013e0h2wcnb.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffqh9kmrxe013e0h2wcnb.jpg" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2.5 Prepare additional SSD
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2c42e2asit3ijfi8tfl1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2c42e2asit3ijfi8tfl1.jpg" width="800" height="537"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2.6 Install additional SSD
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F60nlvawj2xusl7yk4nbv.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F60nlvawj2xusl7yk4nbv.jpg" width="800" height="536"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2.7 Assemble laptop
&lt;/h3&gt;

&lt;p&gt;Assemble it back in the reverse order.&lt;/p&gt;

&lt;h2&gt;
  
  
  3 Check if the installation is successful
&lt;/h2&gt;

&lt;h3&gt;
  
  
  3.1 Check from BIOS
&lt;/h3&gt;

&lt;p&gt;Check that BIOS sees both old and new SSDs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SSD1: (1TB) WD PC SN740 SDDPMQD-1T00-1101&lt;/li&gt;
&lt;li&gt;SSD2: (2TB) Samsung SSD 990 PRO 2TB&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fekvgp5otj0edqdsd77qp.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fekvgp5otj0edqdsd77qp.jpg" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo3v7j7qu7hhapm38z2mf.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo3v7j7qu7hhapm38z2mf.jpg" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  3.2 Benchmark tests from Windows
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3udkntouc2xu61qu94kc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3udkntouc2xu61qu94kc.png" width="502" height="511"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnajkdqpft6slkbpq2y20.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnajkdqpft6slkbpq2y20.png" width="505" height="514"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd0o2lwhuhlzgqml3xw7b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd0o2lwhuhlzgqml3xw7b.png" width="494" height="361"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx1gqqbfgjljr4u6asmvo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx1gqqbfgjljr4u6asmvo.png" width="489" height="358"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have no idea why those 2 benchmark tools give different results.&lt;/p&gt;

</description>
      <category>ssd</category>
      <category>lenovo</category>
      <category>laptop</category>
    </item>
    <item>
      <title>XSD Tools in .NET8 – Part10 – LiquidXMLObjects - Advanced</title>
      <dc:creator>Mark Pelf</dc:creator>
      <pubDate>Fri, 08 Nov 2024 12:59:27 +0000</pubDate>
      <link>https://dev.to/markpelf/xsd-tools-in-net8-part10-liquidxmlobjects-advanced-4n1j</link>
      <guid>https://dev.to/markpelf/xsd-tools-in-net8-part10-liquidxmlobjects-advanced-4n1j</guid>
      <description>&lt;p&gt;A practical guide to XSD tools available in .NET8 environment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Abstract: A practical guide to XML and XSD tools available in .NET8 environment, focusing on generating and using C# classes to process some XML valid for some given XSD (technology as of September 2024).&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1 Doing XML and XSD related work in .NET8
&lt;/h2&gt;

&lt;p&gt;I was recently doing some work related to XML and XSD processing in .NET8 environment and created several &lt;strong&gt;&lt;em&gt;proof-of-concept applications&lt;/em&gt;&lt;/strong&gt; to evaluate the tools available. These articles are the result of my &lt;strong&gt;&lt;em&gt;prototyping work&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  1.1 List of tools used/tested
&lt;/h3&gt;

&lt;p&gt;Here are the tools used/tested:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Visual Studio 2022&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;XSD.EXE&lt;/strong&gt; (Microsoft license, part of VS2022)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;XmlSchemaClassGenerator&lt;/strong&gt; (Open Source/Freeware)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LinqToXsdCore&lt;/strong&gt; (Open Source/Freeware)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Liquid XML Objects&lt;/strong&gt; (Commercial license)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  1.2 Articles in this series
&lt;/h3&gt;

&lt;p&gt;For technical reasons, I will organize this text into several articles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;XSD Tools in .NET8 – Part1 – VS2022&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;XSD Tools in .NET8 – Part2 – C# validation&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;XSD Tools in .NET8 – Part3 – XsdExe – Simple&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;XSD Tools in .NET8 – Part4 – XsdExe - Advanced&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;XSD Tools in .NET8 – Part5 – XmlSchemaClassGenerator – Simple&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;XSD Tools in .NET8 – Part6 – XmlSchemaClassGenerator – Advanced&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;XSD Tools in .NET8 – Part7 – LinqToXsdCore – Simple&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;XSD Tools in .NET8 – Part8 – LinqToXsdCore – Advanced&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;XSD Tools in .NET8 – Part9 – LiquidXMLObjects – Simple&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;XSD Tools in .NET8 – Part10 – LiquidXMLObjects – Advanced&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2 More theory about XML and XSD rules
&lt;/h2&gt;

&lt;p&gt;Here is some more theory about XML and XSD rules.&lt;/p&gt;

&lt;h3&gt;
  
  
  2.1 Optional Xml-Element and Xml-Attribute
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Optional&lt;/strong&gt;: Does not need to be present in the XML.&lt;/p&gt;

&lt;p&gt;For XSD Schema elements:&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Optional&lt;/strong&gt;: minOccurs="0" attribute -&amp;gt;In order to set a schema element as optional, you include the minOccurs="0" attribute&lt;/p&gt;
&lt;h3&gt;
  
  
  2.2 The Difference Between Optional and Not Required for Xml-Element and Xml-Attribute
&lt;/h3&gt;

&lt;p&gt;Note the difference:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Optional&lt;/strong&gt;: Does not need to be present in the XML.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not Required&lt;/strong&gt;: Does not need to have a value.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can have any combination:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Optional + Not Required&lt;/li&gt;
&lt;li&gt;Optional + Required&lt;/li&gt;
&lt;li&gt;Not Optional + Not Required&lt;/li&gt;
&lt;li&gt;Not Optional + Required&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For XSD Schema elements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Optional&lt;/strong&gt;: minOccurs="0" attribute -&amp;gt;In order to set a schema element as optional, you include the minOccurs="0" attribute&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Required&lt;/strong&gt;: nillable="true" attribute -&amp;gt;In order to set a schema element as not required, you include the nillable="true" attribute.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;String data types are not required by default, though you can force them to be required.&lt;br&gt;&lt;br&gt;
Other data types, such as Boolean, Integer, Date, Time, etc. are all required by default. In order to make one of these data types not required, you must set the nillable attribute equal to true for the element in the schema.&lt;/p&gt;
&lt;h2&gt;
  
  
  3 Examples of XML and XSD
&lt;/h2&gt;

&lt;p&gt;Here are some sample XML-s and XSD-s I created for test purposes.&lt;/p&gt;
&lt;h3&gt;
  
  
  3.1 Advanced case
&lt;/h3&gt;

&lt;p&gt;Please note that this example XML/XSD has an &lt;strong&gt;&lt;em&gt;Optional and Not-Required Xml-Element&lt;/em&gt;&lt;/strong&gt;. Read the comments inside for more details.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!--SmallCompany.xsd++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;xs:schema&lt;/span&gt; &lt;span class="na"&gt;attributeFormDefault=&lt;/span&gt;&lt;span class="s"&gt;"unqualified"&lt;/span&gt; 
           &lt;span class="na"&gt;elementFormDefault=&lt;/span&gt;&lt;span class="s"&gt;"qualified"&lt;/span&gt; 
           &lt;span class="na"&gt;targetNamespace=&lt;/span&gt;&lt;span class="s"&gt;"https://markpelf.com/SmallCompany.xsd"&lt;/span&gt; 
           &lt;span class="na"&gt;xmlns:xs=&lt;/span&gt;&lt;span class="s"&gt;"http://www.w3.org/2001/XMLSchema"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"SmallCompany"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;xs:complexType&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;xs:sequence&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"CompanyName"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"xs:string"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;maxOccurs=&lt;/span&gt;&lt;span class="s"&gt;"unbounded"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"Employee"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;xs:complexType&amp;gt;&lt;/span&gt;
                        &lt;span class="nt"&gt;&amp;lt;xs:sequence&amp;gt;&lt;/span&gt;
                            &lt;span class="c"&gt;&amp;lt;!--Name_String_NO is String NotOptional--&amp;gt;&lt;/span&gt;
                            &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"Name_String_NO"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"xs:string"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
                            &lt;span class="c"&gt;&amp;lt;!--City_String_O is String Optional--&amp;gt;&lt;/span&gt;
                            &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;minOccurs=&lt;/span&gt;&lt;span class="s"&gt;"0"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"City_String_O"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"xs:string"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span class="nt"&gt;&amp;lt;/xs:sequence&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;/xs:complexType&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;/xs:element&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;maxOccurs=&lt;/span&gt;&lt;span class="s"&gt;"unbounded"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"InfoData"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;xs:complexType&amp;gt;&lt;/span&gt;
                        &lt;span class="nt"&gt;&amp;lt;xs:sequence&amp;gt;&lt;/span&gt;
                            &lt;span class="c"&gt;&amp;lt;!--Id_Int_NO is Int NotOptional--&amp;gt;&lt;/span&gt;
                            &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"Id_Int_NO"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"xs:int"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
                            &lt;span class="c"&gt;&amp;lt;!--Quantity_Int_O is Int Optional--&amp;gt;&lt;/span&gt;
                            &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;minOccurs=&lt;/span&gt;&lt;span class="s"&gt;"0"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"Quantity_Int_O"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"xs:int"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span class="nt"&gt;&amp;lt;/xs:sequence&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;/xs:complexType&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;/xs:element&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;/xs:sequence&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/xs:complexType&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/xs:element&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/xs:schema&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!--SmallCompanyAAA.xml+++++++++++++++++++++++++++++++++++++++++++++++--&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;SmallCompany&lt;/span&gt; &lt;span class="na"&gt;xmlns=&lt;/span&gt;&lt;span class="s"&gt;"https://markpelf.com/SmallCompany.xsd"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;CompanyName&amp;gt;&lt;/span&gt;SmallCompanyAAA&lt;span class="nt"&gt;&amp;lt;/CompanyName&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;Employee&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;Name_String_NO&amp;gt;&lt;/span&gt;Mark&lt;span class="nt"&gt;&amp;lt;/Name_String_NO&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;City_String_O&amp;gt;&lt;/span&gt;Belgrade&lt;span class="nt"&gt;&amp;lt;/City_String_O&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/Employee&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;Employee&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;Name_String_NO&amp;gt;&lt;/span&gt;John&lt;span class="nt"&gt;&amp;lt;/Name_String_NO&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/Employee&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;InfoData&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;Id_Int_NO&amp;gt;&lt;/span&gt;11&lt;span class="nt"&gt;&amp;lt;/Id_Int_NO&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;Quantity_Int_O&amp;gt;&lt;/span&gt;123&lt;span class="nt"&gt;&amp;lt;/Quantity_Int_O&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/InfoData&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;InfoData&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;Id_Int_NO&amp;gt;&lt;/span&gt;22&lt;span class="nt"&gt;&amp;lt;/Id_Int_NO&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/InfoData&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/SmallCompany&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4 Using LiquidXMLObjects tool to create C# class
&lt;/h2&gt;

&lt;p&gt;We focus in this article on the usage of LiquidXMLObjects tool to generate C# class from XSD file.&lt;br&gt;&lt;br&gt;
Here is the tool's basic info.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
Tool name:  ============================
Liquid XML Objects

License============================ 
2 licenses:
1) Free Community Edition: Home Users and Students, XML Schema (size limited)
2) Commercial Product, Developer Bundle (Installed) $770.94 (perpetual license)

Where to get it============================
https://www.liquid-technologies.com/xml-objects

Install Instructions====================================
-a free trial which will expire 15 days after activation, after this time the product will continue to operate as the Free Community Edition.

Version============================
Liquid Studio - Community Edition 20.7.14.13112

Help============================
https://www.liquid-technologies.com/Reference/XmlDataBinding/xml-objects-introduction.html
====================================================    
Usage Examples===================                         
Instructions to generate C# class 
Using GUI - context right click on .xsd file
====================================


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4.1 GUI
&lt;/h3&gt;

&lt;p&gt;This commercial product has an impressive GUI to issue commands. Here is how C# classes are generated.&lt;/p&gt;

&lt;p&gt;You use the right-click menu to invoke C# class generation&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr1p0tsxxskaegbq1qsxs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr1p0tsxxskaegbq1qsxs.png" width="455" height="388"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And here are the options I set for C# code generation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5ln2jkckewarjnkn2t8d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5ln2jkckewarjnkn2t8d.png" width="639" height="808"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5 Generated C# class
&lt;/h2&gt;

&lt;p&gt;Here is the C# generated by the above tool based on the above presented XSD BigCompany.xsd.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;///////////////////////////////////////////////////////////////////////////&lt;/span&gt;
&lt;span class="c1"&gt;//           Liquid XML Objects GENERATED CODE - DO NOT MODIFY           //&lt;/span&gt;
&lt;span class="c1"&gt;//            https://www.liquid-technologies.com/xml-objects            //&lt;/span&gt;
&lt;span class="c1"&gt;//=======================================================================//&lt;/span&gt;
&lt;span class="c1"&gt;// Dependencies                                                          //&lt;/span&gt;
&lt;span class="c1"&gt;//     Nuget : LiquidTechnologies.XmlObjects.Runtime                     //&lt;/span&gt;
&lt;span class="c1"&gt;//           : MUST BE VERSION 20.7.14                                   //&lt;/span&gt;
&lt;span class="c1"&gt;//=======================================================================//&lt;/span&gt;
&lt;span class="c1"&gt;// Online Help                                                           //&lt;/span&gt;
&lt;span class="c1"&gt;//     https://www.liquid-technologies.com/xml-objects-quick-start-guide //&lt;/span&gt;
&lt;span class="c1"&gt;//=======================================================================//&lt;/span&gt;
&lt;span class="c1"&gt;// Licensing Information                                                 //&lt;/span&gt;
&lt;span class="c1"&gt;//     https://www.liquid-technologies.com/eula                          //&lt;/span&gt;
&lt;span class="c1"&gt;///////////////////////////////////////////////////////////////////////////&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System.ComponentModel&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System.Collections.Generic&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System.Linq&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System.Xml.Linq&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System.Numerics&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;LiquidTechnologies.XmlObjects&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;LiquidTechnologies.XmlObjects.Attribution&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// ------------------------------------------------------&lt;/span&gt;
&lt;span class="c1"&gt;// |                      Settings                      |&lt;/span&gt;
&lt;span class="c1"&gt;// ------------------------------------------------------&lt;/span&gt;
&lt;span class="c1"&gt;// GenerateCommonBaseClass                  = False&lt;/span&gt;
&lt;span class="c1"&gt;// GenerateUnprocessedNodeHandlers          = False&lt;/span&gt;
&lt;span class="c1"&gt;// RaiseChangeEvents                        = False&lt;/span&gt;
&lt;span class="c1"&gt;// CollectionNaming                         = Pluralize&lt;/span&gt;
&lt;span class="c1"&gt;// Language                                 = CS&lt;/span&gt;
&lt;span class="c1"&gt;// OutputNamespace                          = XsdExample_Ver4.XSD2&lt;/span&gt;
&lt;span class="c1"&gt;// WriteDefaultValuesForOptionalAttributes  = True&lt;/span&gt;
&lt;span class="c1"&gt;// WriteDefaultValuesForOptionalElements    = True&lt;/span&gt;
&lt;span class="c1"&gt;// MixedContentHandling                     = TreatAsAny&lt;/span&gt;
&lt;span class="c1"&gt;// GenerationModel                          = Simple&lt;/span&gt;
&lt;span class="c1"&gt;//                                            *WARNING* this simplified model that is very easy to work with&lt;/span&gt;
&lt;span class="c1"&gt;//                                            but may cause the XML to be produced without regard for element&lt;/span&gt;
&lt;span class="c1"&gt;//                                            cardinality or order. Where very high compliance with the XML Schema&lt;/span&gt;
&lt;span class="c1"&gt;//                                            standard is required use GenerationModelType.Conformant&lt;/span&gt;
&lt;span class="c1"&gt;// XSD Schema Files&lt;/span&gt;
&lt;span class="c1"&gt;//    C:\TmpXSD\XsdExample_Ver4\Example01\XSD2\BigCompany.xsd&lt;/span&gt;


&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;XsdExample_Ver4.XSD2&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="n"&gt;region&lt;/span&gt; &lt;span class="n"&gt;Global&lt;/span&gt; &lt;span class="n"&gt;Settings&lt;/span&gt;
    &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;Contains library level properties, and ensures the version of the runtime used matches the version used to generate it.&amp;lt;/summary&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxRuntimeRequirements&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"20.7.14.13112"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Free Community Edition"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"M9WDQLWDQNEEVNLX"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;LiquidTechnologies&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XmlObjects&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;LicenseTermsType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CommunityEdition&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;partial&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;LxRuntimeRequirementsWritten&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="n"&gt;endregion&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;XsdExample_Ver4.XSD2.Xs&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="n"&gt;region&lt;/span&gt; &lt;span class="n"&gt;Complex&lt;/span&gt; &lt;span class="n"&gt;Types&lt;/span&gt;
    &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;A class representing the root XSD complexType anyType@http://www.w3.org/2001/XMLSchema&amp;lt;/summary&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxSimpleComplexTypeDefinition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"anyType"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"http://www.w3.org/2001/XMLSchema"&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;partial&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;AnyTypeCt&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;XElement&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;Constructor : create a &amp;lt;see cref="AnyTypeCt" /&amp;gt; element &amp;amp;lt;anyType xmlns='http://www.w3.org/2001/XMLSchema'&amp;amp;gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nf"&gt;AnyTypeCt&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;base&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;XName&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"anyType"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"http://www.w3.org/2001/XMLSchema"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="n"&gt;endregion&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;XsdExample_Ver4.XSD2.Tns&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="n"&gt;region&lt;/span&gt; &lt;span class="n"&gt;Elements&lt;/span&gt;
    &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;A class representing the root XSD element BigCompany@https://markpelf.com/BigCompany.xsd&amp;lt;/summary&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxSimpleElementDefinition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"BigCompany"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"https://markpelf.com/BigCompany.xsd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ElementScopeType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;GlobalElement&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;partial&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;BigCompanyElm&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;A &amp;lt;see cref="System.String" /&amp;gt;, Required : should not be set to null&amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxElementValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"CompanyName"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"https://markpelf.com/BigCompany.xsd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;LxValueType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;XsdType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XsdString&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MinOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MaxOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;String&lt;/span&gt; &lt;span class="n"&gt;CompanyName&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;A collection of &amp;lt;see cref="XsdExample_Ver4.XSD2.Tns.BigCompanyElm.EmployeeElm" /&amp;gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxElementRef&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MinOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MaxOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;LxConstants&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Unbounded&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;XsdExample_Ver4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XSD2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Tns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;BigCompanyElm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;EmployeeElm&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Employees&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;XsdExample_Ver4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XSD2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Tns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;BigCompanyElm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;EmployeeElm&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;();&lt;/span&gt;

        &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;A collection of &amp;lt;see cref="XsdExample_Ver4.XSD2.Tns.BigCompanyElm.InfoDataElm" /&amp;gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxElementRef&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MinOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MaxOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;LxConstants&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Unbounded&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;XsdExample_Ver4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XSD2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Tns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;BigCompanyElm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;InfoDataElm&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;InfoData&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;XsdExample_Ver4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XSD2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Tns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;BigCompanyElm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;InfoDataElm&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;();&lt;/span&gt;

        &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;Represent the inline xs:element Employee@https://markpelf.com/BigCompany.xsd.&amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxSimpleElementDefinition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Employee"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"https://markpelf.com/BigCompany.xsd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ElementScopeType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;InlineElement&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;partial&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;EmployeeElm&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;A &amp;lt;see cref="System.String" /&amp;gt;, Required : should not be set to null&amp;lt;/summary&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxElementValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Name_String_NO"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"https://markpelf.com/BigCompany.xsd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;LxValueType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;XsdType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XsdString&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MinOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MaxOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
            &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;String&lt;/span&gt; &lt;span class="n"&gt;Name_String_NO&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

            &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;A &amp;lt;see cref="System.String" /&amp;gt;, Optional : null when not set&amp;lt;/summary&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxElementValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"City_String_O"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"https://markpelf.com/BigCompany.xsd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;LxValueType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;XsdType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XsdString&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MinOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MaxOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
            &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="n"&gt;City_String_O&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;Represent the inline xs:element InfoData@https://markpelf.com/BigCompany.xsd.&amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxSimpleElementDefinition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"InfoData"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"https://markpelf.com/BigCompany.xsd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ElementScopeType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;InlineElement&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;partial&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;InfoDataElm&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;A &amp;lt;see cref="System.Int32" /&amp;gt;, Required&amp;lt;/summary&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxElementValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Data1_Int_NO_R"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"https://markpelf.com/BigCompany.xsd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;LxValueType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;XsdType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XsdInt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MinOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MaxOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
            &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Int32&lt;/span&gt; &lt;span class="n"&gt;Data1_Int_NO_R&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

            &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;A &amp;lt;see cref="System.Int32" /&amp;gt;, Required&amp;lt;/summary&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxElementValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Data2_Int_NO_NR"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"https://markpelf.com/BigCompany.xsd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;LxValueType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;XsdType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XsdInt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MinOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MaxOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
            &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;LxNillable&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Int32&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Data2_Int_NO_NR&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;LxNillable&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Int32&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;.&lt;/span&gt;&lt;span class="nf"&gt;Create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Int32&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

            &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;A nullable &amp;lt;see cref="System.Int32" /&amp;gt;, Optional : null when not set&amp;lt;/summary&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxElementValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Data3_Int_O_R"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"https://markpelf.com/BigCompany.xsd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;LxValueType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;XsdType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XsdInt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MinOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MaxOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
            &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Int32&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="n"&gt;Data3_Int_O_R&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

            &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;A nullable &amp;lt;see cref="System.Int32" /&amp;gt;, Optional : null when not set&amp;lt;/summary&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxElementValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Data4_Int_O_NR"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"https://markpelf.com/BigCompany.xsd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;LxValueType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;XsdType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XsdInt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MinOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MaxOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
            &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;LxNillable&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Int32&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Data4_Int_O_NR&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="n"&gt;endregion&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is the class diagram.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe5jokzarfrhd8ibvgn26.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe5jokzarfrhd8ibvgn26.png" width="355" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6 Two C# API styles for Optional Xml-Elements
&lt;/h2&gt;

&lt;p&gt;There are two approaches/styles for marking Optional Xml-Element presence in generated C# code:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The first is &lt;strong&gt;bool_flag_style&lt;/strong&gt; – using a bool flag to indicate the presence of optional Xml-Element, with flag=false to indicate the Xml-Element was not present.
For example, for some Xml-Element &lt;strong&gt;&lt;em&gt;ElemA&lt;/em&gt;&lt;/strong&gt; that, if present, will have value integer, you will get in C# generated two variables “&lt;strong&gt;&lt;em&gt;bool ElemA_flag, int ElemA_value&lt;/em&gt;&lt;/strong&gt;”. You need to check if element &lt;strong&gt;&lt;em&gt;ElemA&lt;/em&gt;&lt;/strong&gt; was present by first checking the flag &lt;strong&gt;&lt;em&gt;ElemA_flag&lt;/em&gt;&lt;/strong&gt;; and then if it is true, you go for the value of &lt;strong&gt;&lt;em&gt;ElemA_value&lt;/em&gt;&lt;/strong&gt;. If you do not check flag &lt;strong&gt;&lt;em&gt;ElemA_flag&lt;/em&gt;&lt;/strong&gt; first, and just go for the value of &lt;strong&gt;&lt;em&gt;ElemA_value&lt;/em&gt;&lt;/strong&gt; you might pick the default int value of zero (0), and you can not know if that is just the default value for C# variable that is always present, but Xml-Element was not present, or that element was present and it actually had the value of zero (0).&lt;/li&gt;
&lt;li&gt;The second is &lt;strong&gt;nullable_type_style&lt;/strong&gt; – using a nullable type to indicate the presence of Xml-Element, with value=null to indicate the Xml-Element was not present.
For example, for some Xml-Element &lt;strong&gt;&lt;em&gt;ElemA&lt;/em&gt;&lt;/strong&gt; that, if present, will have value integer, you will get in C# generated variable “&lt;strong&gt;&lt;em&gt;int? ElemA_nullableValue&lt;/em&gt;&lt;/strong&gt;”. You need to check if element &lt;strong&gt;&lt;em&gt;ElemA&lt;/em&gt;&lt;/strong&gt; was present by first checking the &lt;strong&gt;&lt;em&gt;ElemA_nullableValue&lt;/em&gt;&lt;/strong&gt; not being null; and then if it is not meaning the element was present, you go for the int value of &lt;strong&gt;&lt;em&gt;ElemA_nullableValue&lt;/em&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  7 Sample C# app
&lt;/h2&gt;

&lt;p&gt;Here is a sample C# code using the above generated C# class to load and process the above presented XML BigCompanyMMM.xml.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;ProcessVer4_Process2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="n"&gt;filePath&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;Microsoft&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Extensions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ILogger&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="s"&gt;"+++ProcessVer4_Process2-Start++++++++++++++++++"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"filePath:"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;filePath&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="n"&gt;LxSerializer&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;XsdExample_Ver4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XSD2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Tns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;BigCompanyElm&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;serializer&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt;
            &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;LxSerializer&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;XsdExample_Ver4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XSD2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Tns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;BigCompanyElm&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;();&lt;/span&gt;
        &lt;span class="n"&gt;TextReader&lt;/span&gt; &lt;span class="n"&gt;textReader&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;File&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;OpenText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;filePath&lt;/span&gt; &lt;span class="p"&gt;??&lt;/span&gt; &lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Empty&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;LxReaderSettings&lt;/span&gt; &lt;span class="n"&gt;readerSettings&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;LxReaderSettings&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

        &lt;span class="n"&gt;XsdExample_Ver4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XSD2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Tns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;BigCompanyElm&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="n"&gt;xmlObject&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt;
            &lt;span class="n"&gt;serializer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Deserialize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;textReader&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;readerSettings&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;xmlObject&lt;/span&gt; &lt;span class="p"&gt;!=&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"CompanyName:"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;xmlObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CompanyName&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

            &lt;span class="k"&gt;foreach&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;XsdExample_Ver4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XSD2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Tns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;BigCompanyElm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;EmployeeElm&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;xmlObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Employees&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"------------"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Name_String_NO:"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Name_String_NO&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"City_String_O:"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;City_String_O&lt;/span&gt; &lt;span class="p"&gt;??&lt;/span&gt; &lt;span class="s"&gt;"null"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;

            &lt;span class="k"&gt;foreach&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;XsdExample_Ver4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XSD2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Tns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;BigCompanyElm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;InfoDataElm&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;xmlObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;InfoData&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"------------"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Data1_Int_NO_R:"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Data1_Int_NO_R&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ToString&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
                &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Data2_Int_NO_NR:"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; 
                    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Data2_Int_NO_NR&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;IsNil&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="s"&gt;"nill"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Data2_Int_NO_NR&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Value&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

                &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Data3_Int_O_R:"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Data3_Int_O_R&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;ToString&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;??&lt;/span&gt; &lt;span class="s"&gt;"null"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

                &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Data4_Int_O_NR:"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; 
                    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Data4_Int_O_NR&lt;/span&gt;&lt;span class="p"&gt;==&lt;/span&gt;&lt;span class="k"&gt;null&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="s"&gt;"null"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;
                     &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Data4_Int_O_NR&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;IsNil&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="s"&gt;"nil"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Data4_Int_O_NR&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Value&lt;/span&gt;&lt;span class="p"&gt;)));&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"xmlObject == null"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="s"&gt;"+++ProcessVer4_Process2-End++++++++++++++++++"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Exception&lt;/span&gt; &lt;span class="n"&gt;ex&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;methodName&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt;
            &lt;span class="s"&gt;$"Type: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Reflection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;MethodBase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;GetCurrentMethod&lt;/span&gt;&lt;span class="p"&gt;()?.&lt;/span&gt;&lt;span class="n"&gt;DeclaringType&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="n"&gt;FullName&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;, "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;
            &lt;span class="s"&gt;$"Method: ProcessVer4_Process2; "&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ex&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;methodName&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And here is the log of execution.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; +++ProcessVer4_Process2-Start++++++++++++++++++
 filePath:C:\TmpXSD\XsdExample_Ver4\Example01\bin\Debug\net8.0\XmlFiles\BigCompanyMMM.xml
 CompanyName:BigCompanyMMM
 ------------
 Name_String_NO:Mark
 City_String_O:Belgrade
 ------------
 Name_String_NO:John
 City_String_O:null
 ------------
 Data1_Int_NO_R:555
 Data2_Int_NO_NR:16
 Data3_Int_O_R:333
 Data4_Int_O_NR:17
 ------------
 Data1_Int_NO_R:123
 Data2_Int_NO_NR:nill
 Data3_Int_O_R:15
 Data4_Int_O_NR:nil
 ------------
 Data1_Int_NO_R:777
 Data2_Int_NO_NR:nill
 Data3_Int_O_R:null
 Data4_Int_O_NR:null
 +++ProcessVer4_Process2-End++++++++++++++++++

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  8 Analysis
&lt;/h2&gt;

&lt;p&gt;This tool uses “&lt;strong&gt;nullable_type_style&lt;/strong&gt;” approach/style to mark Optional Xml-Element presence in generated C# code. To enable the indication of &lt;strong&gt;“nill”&lt;/strong&gt; it uses a special object class as a result.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Data1_Int_NO_R&lt;/strong&gt; - is int type and always has value&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data2_Int_NO_NR&lt;/strong&gt; - is an object of a certain class and can have 2 values:, 1) &lt;strong&gt;“nill”&lt;/strong&gt;, 2)int.
a) &lt;strong&gt;“nill”&lt;/strong&gt;– present but &lt;strong&gt;“nill”&lt;/strong&gt;
b) int – present and had value&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data3_Int_O_R&lt;/strong&gt; – is int? type and the meaning is
1) null - means it was not present
2) int – present and had value&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data4_Int_O_NR&lt;/strong&gt; - is an object of a certain class and can have 3 values: 1)null, 2) &lt;strong&gt;“nill”&lt;/strong&gt;, 3)int.
1) null – means the element was not present
2) &lt;strong&gt;“nill”&lt;/strong&gt;– element was present but &lt;strong&gt;“nill”&lt;/strong&gt;
3) int – element was present and had value&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is interesting to notice that this tool is using the modern API style/approach “&lt;strong&gt;nullable_type_style&lt;/strong&gt;”&lt;strong&gt;.&lt;/strong&gt; But, it still has the ability in the case of Xml-Element &lt;strong&gt;Data4_Int_O_NR&lt;/strong&gt; to indicate all three states: “not-present”, “present-nill”, “present-int”. The way they achieve it is by using a special class/object to represent ternary value.&lt;/p&gt;

&lt;h2&gt;
  
  
  9 Conclusion
&lt;/h2&gt;

&lt;p&gt;This tool LiquidXMLObjects is very interesting but requires a &lt;strong&gt;commercial license&lt;/strong&gt;. The code generated looked solid in my test. It can be of great interest to users who want to use &lt;strong&gt;nullable_type_style&lt;/strong&gt; API, which is generally a more modern approach for handling the Optional Xml-Elements.  &lt;/p&gt;

&lt;p&gt;The full example code project can be downloaded at GitHub [99].&lt;/p&gt;

&lt;h2&gt;
  
  
  10 References
&lt;/h2&gt;

&lt;p&gt;[1] XML Schema&lt;br&gt;&lt;br&gt;
&lt;a href="https://www.w3schools.com/xml/xml_schema.asp" rel="noopener noreferrer"&gt;https://www.w3schools.com/xml/xml_schema.asp&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[2] The Difference Between Optional and Not Required&lt;br&gt;&lt;br&gt;
&lt;a href="https://www.infopathdev.com/blogs/greg/archive/2004/09/16/The-Difference-Between-Optional-and-Not-Required.aspx" rel="noopener noreferrer"&gt;https://www.infopathdev.com/blogs/greg/archive/2004/09/16/The-Difference-Between-Optional-and-Not-Required.aspx&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[3] nillable and minOccurs XSD element attributes&lt;br&gt;&lt;br&gt;
&lt;a href="https://stackoverflow.com/questions/1903062/nillable-and-minoccurs-xsd-element-attributes" rel="noopener noreferrer"&gt;https://stackoverflow.com/questions/1903062/nillable-and-minoccurs-xsd-element-attributes&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[99] &lt;a href="https://github.com/MarkPelf/XsdToolsInNet8" rel="noopener noreferrer"&gt;https://github.com/MarkPelf/XsdToolsInNet8&lt;/a&gt; &lt;/p&gt;

</description>
      <category>csharp</category>
      <category>xml</category>
      <category>xsd</category>
    </item>
    <item>
      <title>XSD Tools in .NET8 – Part9 – LiquidXMLObjects- Simple</title>
      <dc:creator>Mark Pelf</dc:creator>
      <pubDate>Fri, 08 Nov 2024 12:57:53 +0000</pubDate>
      <link>https://dev.to/markpelf/xsd-tools-in-net8-part9-liquidxmlobjects-simple-3276</link>
      <guid>https://dev.to/markpelf/xsd-tools-in-net8-part9-liquidxmlobjects-simple-3276</guid>
      <description>&lt;h1&gt;
  
  
  XSD Tools in .NET8 – Part9 – LiquidXMLObjects- Simple
&lt;/h1&gt;

&lt;p&gt;A practical guide to XSD tools available in .NET8 environment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Abstract: A practical guide to XML and XSD tools available in .NET8 environment, focusing on generating and using C# classes to process some XML valid for some given XSD (technology as of September 2024).&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1 Doing XML and XSD related work in .NET8
&lt;/h2&gt;

&lt;p&gt;I was recently doing some work related to XML and XSD processing in .NET8 environment and created several &lt;strong&gt;&lt;em&gt;proof-of-concept applications&lt;/em&gt;&lt;/strong&gt; to evaluate the tools available. These articles are the result of my &lt;strong&gt;&lt;em&gt;prototyping work&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  1.1 List of tools used/tested
&lt;/h3&gt;

&lt;p&gt;Here are the tools used/tested:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Visual Studio 2022&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;XSD.EXE&lt;/strong&gt; (Microsoft license, part of VS2022)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;XmlSchemaClassGenerator&lt;/strong&gt; (Open Source/Freeware)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LinqToXsdCore&lt;/strong&gt; (Open Source/Freeware)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Liquid XML Objects&lt;/strong&gt; (Commercial license)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  1.2 Articles in this series
&lt;/h3&gt;

&lt;p&gt;For technical reasons, I will organize this text into several articles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;XSD Tools in .NET8 – Part1 – VS2022&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;XSD Tools in .NET8 – Part2 – C# validation&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;XSD Tools in .NET8 – Part3 – XsdExe – Simple&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;XSD Tools in .NET8 – Part4 – XsdExe - Advanced&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;XSD Tools in .NET8 – Part5 – XmlSchemaClassGenerator – Simple&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;XSD Tools in .NET8 – Part6 – XmlSchemaClassGenerator – Advanced&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;XSD Tools in .NET8 – Part7 – LinqToXsdCore – Simple&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;XSD Tools in .NET8 – Part8 – LinqToXsdCore – Advanced&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;XSD Tools in .NET8 – Part9 – LiquidXMLObjects – Simple&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;XSD Tools in .NET8 – Part10 – LiquidXMLObjects – Advanced&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2 More theory about XML and XSD rules
&lt;/h2&gt;

&lt;p&gt;Here is some more theory about XML and XSD rules.&lt;/p&gt;

&lt;h3&gt;
  
  
  2.1 Optional Xml-Element and Xml-Attribute
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Optional&lt;/strong&gt;: Does not need to be present in the XML.&lt;/p&gt;

&lt;p&gt;For XSD Schema elements:&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Optional&lt;/strong&gt;: minOccurs="0" attribute -&amp;gt;In order to set a schema element as optional, you include the minOccurs="0" attribute&lt;/p&gt;
&lt;h2&gt;
  
  
  3 Examples of XML and XSD
&lt;/h2&gt;

&lt;p&gt;Here are some sample XML-s and XSD-s I created for test purposes.&lt;/p&gt;
&lt;h3&gt;
  
  
  3.1 Simple case
&lt;/h3&gt;

&lt;p&gt;Please note that this example XML/XSD has an &lt;strong&gt;&lt;em&gt;Optional Xml-Element&lt;/em&gt;&lt;/strong&gt;. Read the comments inside for more details.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!--SmallCompany.xsd++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;xs:schema&lt;/span&gt; &lt;span class="na"&gt;attributeFormDefault=&lt;/span&gt;&lt;span class="s"&gt;"unqualified"&lt;/span&gt; 
           &lt;span class="na"&gt;elementFormDefault=&lt;/span&gt;&lt;span class="s"&gt;"qualified"&lt;/span&gt; 
           &lt;span class="na"&gt;targetNamespace=&lt;/span&gt;&lt;span class="s"&gt;"https://markpelf.com/SmallCompany.xsd"&lt;/span&gt; 
           &lt;span class="na"&gt;xmlns:xs=&lt;/span&gt;&lt;span class="s"&gt;"http://www.w3.org/2001/XMLSchema"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"SmallCompany"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;xs:complexType&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;xs:sequence&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"CompanyName"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"xs:string"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;maxOccurs=&lt;/span&gt;&lt;span class="s"&gt;"unbounded"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"Employee"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;xs:complexType&amp;gt;&lt;/span&gt;
                        &lt;span class="nt"&gt;&amp;lt;xs:sequence&amp;gt;&lt;/span&gt;
                            &lt;span class="c"&gt;&amp;lt;!--Name_String_NO is String NotOptional--&amp;gt;&lt;/span&gt;
                            &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"Name_String_NO"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"xs:string"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
                            &lt;span class="c"&gt;&amp;lt;!--City_String_O is String Optional--&amp;gt;&lt;/span&gt;
                            &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;minOccurs=&lt;/span&gt;&lt;span class="s"&gt;"0"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"City_String_O"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"xs:string"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span class="nt"&gt;&amp;lt;/xs:sequence&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;/xs:complexType&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;/xs:element&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;maxOccurs=&lt;/span&gt;&lt;span class="s"&gt;"unbounded"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"InfoData"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;xs:complexType&amp;gt;&lt;/span&gt;
                        &lt;span class="nt"&gt;&amp;lt;xs:sequence&amp;gt;&lt;/span&gt;
                            &lt;span class="c"&gt;&amp;lt;!--Id_Int_NO is Int NotOptional--&amp;gt;&lt;/span&gt;
                            &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"Id_Int_NO"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"xs:int"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
                            &lt;span class="c"&gt;&amp;lt;!--Quantity_Int_O is Int Optional--&amp;gt;&lt;/span&gt;
                            &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;minOccurs=&lt;/span&gt;&lt;span class="s"&gt;"0"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"Quantity_Int_O"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"xs:int"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span class="nt"&gt;&amp;lt;/xs:sequence&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;/xs:complexType&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;/xs:element&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;/xs:sequence&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/xs:complexType&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/xs:element&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/xs:schema&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!--SmallCompany.xsd++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;xs:schema&lt;/span&gt; &lt;span class="na"&gt;attributeFormDefault=&lt;/span&gt;&lt;span class="s"&gt;"unqualified"&lt;/span&gt; 
           &lt;span class="na"&gt;elementFormDefault=&lt;/span&gt;&lt;span class="s"&gt;"qualified"&lt;/span&gt; 
           &lt;span class="na"&gt;targetNamespace=&lt;/span&gt;&lt;span class="s"&gt;"https://markpelf.com/SmallCompany.xsd"&lt;/span&gt; 
           &lt;span class="na"&gt;xmlns:xs=&lt;/span&gt;&lt;span class="s"&gt;"http://www.w3.org/2001/XMLSchema"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"SmallCompany"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;xs:complexType&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;xs:sequence&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"CompanyName"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"xs:string"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;maxOccurs=&lt;/span&gt;&lt;span class="s"&gt;"unbounded"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"Employee"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;xs:complexType&amp;gt;&lt;/span&gt;
                        &lt;span class="nt"&gt;&amp;lt;xs:sequence&amp;gt;&lt;/span&gt;
                            &lt;span class="c"&gt;&amp;lt;!--Name_String_NO is String NotOptional--&amp;gt;&lt;/span&gt;
                            &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"Name_String_NO"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"xs:string"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
                            &lt;span class="c"&gt;&amp;lt;!--City_String_O is String Optional--&amp;gt;&lt;/span&gt;
                            &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;minOccurs=&lt;/span&gt;&lt;span class="s"&gt;"0"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"City_String_O"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"xs:string"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span class="nt"&gt;&amp;lt;/xs:sequence&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;/xs:complexType&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;/xs:element&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;maxOccurs=&lt;/span&gt;&lt;span class="s"&gt;"unbounded"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"InfoData"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;xs:complexType&amp;gt;&lt;/span&gt;
                        &lt;span class="nt"&gt;&amp;lt;xs:sequence&amp;gt;&lt;/span&gt;
                            &lt;span class="c"&gt;&amp;lt;!--Id_Int_NO is Int NotOptional--&amp;gt;&lt;/span&gt;
                            &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"Id_Int_NO"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"xs:int"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
                            &lt;span class="c"&gt;&amp;lt;!--Quantity_Int_O is Int Optional--&amp;gt;&lt;/span&gt;
                            &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;minOccurs=&lt;/span&gt;&lt;span class="s"&gt;"0"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"Quantity_Int_O"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"xs:int"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span class="nt"&gt;&amp;lt;/xs:sequence&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;/xs:complexType&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;/xs:element&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;/xs:sequence&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/xs:complexType&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/xs:element&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/xs:schema&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4 Using LiquidXMLObjects tool to create C# class
&lt;/h2&gt;

&lt;p&gt;We focus in this article on the usage of LiquidXMLObjects tool to generate C# class from XSD file.&lt;br&gt;&lt;br&gt;
Here is the tool's basic info.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
Tool name:  ============================
Liquid XML Objects

License============================ 
2 licenses:
1) Free Community Edition: Home Users and Students, XML Schema (size limited)
2) Commercial Product, Developer Bundle (Installed) $770.94 (perpetual license)

Where to get it============================
https://www.liquid-technologies.com/xml-objects

Install Instructions====================================
-a free trial which will expire 15 days after activation, after this time the product will continue to operate as the Free Community Edition.

Version============================
Liquid Studio - Community Edition 20.7.14.13112

Help============================
https://www.liquid-technologies.com/Reference/XmlDataBinding/xml-objects-introduction.html
====================================================    
Usage Examples===================                         
Instructions to generate C# class 
Using GUI - context right click on .xsd file
====================================


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4.1 GUI
&lt;/h3&gt;

&lt;p&gt;This commercial product has an impressive GUI to issue commands. Here is how C# classes are generated.&lt;/p&gt;

&lt;p&gt;You use the right-click menu to invoke C# class generation&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbi5pi3i79zrxc53gy708.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbi5pi3i79zrxc53gy708.png" width="455" height="388"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And here are the options I set for C# code generation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffuss4jf134swfiy41r0t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffuss4jf134swfiy41r0t.png" width="639" height="808"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5 Generated C# class
&lt;/h2&gt;

&lt;p&gt;Here is the C# generated by the above tool based on the above presented XSD SmallCompany.xsd.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;///////////////////////////////////////////////////////////////////////////&lt;/span&gt;
&lt;span class="c1"&gt;//           Liquid XML Objects GENERATED CODE - DO NOT MODIFY           //&lt;/span&gt;
&lt;span class="c1"&gt;//            https://www.liquid-technologies.com/xml-objects            //&lt;/span&gt;
&lt;span class="c1"&gt;//=======================================================================//&lt;/span&gt;
&lt;span class="c1"&gt;// Dependencies                                                          //&lt;/span&gt;
&lt;span class="c1"&gt;//     Nuget : LiquidTechnologies.XmlObjects.Runtime                     //&lt;/span&gt;
&lt;span class="c1"&gt;//           : MUST BE VERSION 20.7.14                                   //&lt;/span&gt;
&lt;span class="c1"&gt;//=======================================================================//&lt;/span&gt;
&lt;span class="c1"&gt;// Online Help                                                           //&lt;/span&gt;
&lt;span class="c1"&gt;//     https://www.liquid-technologies.com/xml-objects-quick-start-guide //&lt;/span&gt;
&lt;span class="c1"&gt;//=======================================================================//&lt;/span&gt;
&lt;span class="c1"&gt;// Licensing Information                                                 //&lt;/span&gt;
&lt;span class="c1"&gt;//     https://www.liquid-technologies.com/eula                          //&lt;/span&gt;
&lt;span class="c1"&gt;///////////////////////////////////////////////////////////////////////////&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System.ComponentModel&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System.Collections.Generic&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System.Linq&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System.Xml.Linq&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System.Numerics&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;LiquidTechnologies.XmlObjects&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;LiquidTechnologies.XmlObjects.Attribution&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// ------------------------------------------------------&lt;/span&gt;
&lt;span class="c1"&gt;// |                      Settings                      |&lt;/span&gt;
&lt;span class="c1"&gt;// ------------------------------------------------------&lt;/span&gt;
&lt;span class="c1"&gt;// GenerateCommonBaseClass                  = False&lt;/span&gt;
&lt;span class="c1"&gt;// GenerateUnprocessedNodeHandlers          = False&lt;/span&gt;
&lt;span class="c1"&gt;// RaiseChangeEvents                        = False&lt;/span&gt;
&lt;span class="c1"&gt;// CollectionNaming                         = Pluralize&lt;/span&gt;
&lt;span class="c1"&gt;// Language                                 = CS&lt;/span&gt;
&lt;span class="c1"&gt;// OutputNamespace                          = XsdExample_Ver4.XSD1&lt;/span&gt;
&lt;span class="c1"&gt;// WriteDefaultValuesForOptionalAttributes  = True&lt;/span&gt;
&lt;span class="c1"&gt;// WriteDefaultValuesForOptionalElements    = True&lt;/span&gt;
&lt;span class="c1"&gt;// MixedContentHandling                     = TreatAsAny&lt;/span&gt;
&lt;span class="c1"&gt;// GenerationModel                          = Simple&lt;/span&gt;
&lt;span class="c1"&gt;//                                            *WARNING* this simplified model that is very easy to work with&lt;/span&gt;
&lt;span class="c1"&gt;//                                            but may cause the XML to be produced without regard for element&lt;/span&gt;
&lt;span class="c1"&gt;//                                            cardinality or order. Where very high compliance with the XML Schema&lt;/span&gt;
&lt;span class="c1"&gt;//                                            standard is required use GenerationModelType.Conformant&lt;/span&gt;
&lt;span class="c1"&gt;// XSD Schema Files&lt;/span&gt;
&lt;span class="c1"&gt;//    C:\TmpXSD\XsdExample_Ver4\Example01\XSD1\SmallCompany.xsd&lt;/span&gt;


&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;XsdExample_Ver4.XSD1&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="n"&gt;region&lt;/span&gt; &lt;span class="n"&gt;Global&lt;/span&gt; &lt;span class="n"&gt;Settings&lt;/span&gt;
    &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;Contains library level properties, and ensures the version of the runtime used matches the version used to generate it.&amp;lt;/summary&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxRuntimeRequirements&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"20.7.14.13112"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Free Community Edition"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"M9WDQLWDQNEEVNLX"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;LiquidTechnologies&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XmlObjects&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;LicenseTermsType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CommunityEdition&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;partial&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;LxRuntimeRequirementsWritten&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="n"&gt;endregion&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;XsdExample_Ver4.XSD1.Xs&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="n"&gt;region&lt;/span&gt; &lt;span class="n"&gt;Complex&lt;/span&gt; &lt;span class="n"&gt;Types&lt;/span&gt;
    &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;A class representing the root XSD complexType anyType@http://www.w3.org/2001/XMLSchema&amp;lt;/summary&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxSimpleComplexTypeDefinition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"anyType"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"http://www.w3.org/2001/XMLSchema"&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;partial&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;AnyTypeCt&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;XElement&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;Constructor : create a &amp;lt;see cref="AnyTypeCt" /&amp;gt; element &amp;amp;lt;anyType xmlns='http://www.w3.org/2001/XMLSchema'&amp;amp;gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nf"&gt;AnyTypeCt&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;base&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;XName&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"anyType"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"http://www.w3.org/2001/XMLSchema"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="n"&gt;endregion&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;XsdExample_Ver4.XSD1.Tns&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="n"&gt;region&lt;/span&gt; &lt;span class="n"&gt;Elements&lt;/span&gt;
    &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;A class representing the root XSD element SmallCompany@https://markpelf.com/SmallCompany.xsd&amp;lt;/summary&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxSimpleElementDefinition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"SmallCompany"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"https://markpelf.com/SmallCompany.xsd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ElementScopeType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;GlobalElement&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;partial&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SmallCompanyElm&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;A &amp;lt;see cref="System.String" /&amp;gt;, Required : should not be set to null&amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxElementValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"CompanyName"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"https://markpelf.com/SmallCompany.xsd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;LxValueType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;XsdType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XsdString&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MinOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MaxOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;String&lt;/span&gt; &lt;span class="n"&gt;CompanyName&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;A collection of &amp;lt;see cref="XsdExample_Ver4.XSD1.Tns.SmallCompanyElm.EmployeeElm" /&amp;gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxElementRef&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MinOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MaxOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;LxConstants&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Unbounded&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;XsdExample_Ver4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XSD1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Tns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SmallCompanyElm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;EmployeeElm&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Employees&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;XsdExample_Ver4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XSD1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Tns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SmallCompanyElm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;EmployeeElm&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;();&lt;/span&gt;

        &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;A collection of &amp;lt;see cref="XsdExample_Ver4.XSD1.Tns.SmallCompanyElm.InfoDataElm" /&amp;gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxElementRef&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MinOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MaxOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;LxConstants&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Unbounded&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;XsdExample_Ver4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XSD1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Tns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SmallCompanyElm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;InfoDataElm&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;InfoData&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;XsdExample_Ver4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XSD1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Tns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SmallCompanyElm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;InfoDataElm&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;();&lt;/span&gt;

        &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;Represent the inline xs:element Employee@https://markpelf.com/SmallCompany.xsd.&amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxSimpleElementDefinition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Employee"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"https://markpelf.com/SmallCompany.xsd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ElementScopeType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;InlineElement&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;partial&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;EmployeeElm&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;A &amp;lt;see cref="System.String" /&amp;gt;, Required : should not be set to null&amp;lt;/summary&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxElementValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Name_String_NO"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"https://markpelf.com/SmallCompany.xsd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;LxValueType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;XsdType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XsdString&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MinOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MaxOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
            &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;String&lt;/span&gt; &lt;span class="n"&gt;Name_String_NO&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

            &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;A &amp;lt;see cref="System.String" /&amp;gt;, Optional : null when not set&amp;lt;/summary&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxElementValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"City_String_O"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"https://markpelf.com/SmallCompany.xsd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;LxValueType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;XsdType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XsdString&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MinOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MaxOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
            &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="n"&gt;City_String_O&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;Represent the inline xs:element InfoData@https://markpelf.com/SmallCompany.xsd.&amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxSimpleElementDefinition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"InfoData"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"https://markpelf.com/SmallCompany.xsd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ElementScopeType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;InlineElement&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;partial&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;InfoDataElm&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;A &amp;lt;see cref="System.Int32" /&amp;gt;, Required&amp;lt;/summary&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxElementValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Id_Int_NO"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"https://markpelf.com/SmallCompany.xsd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;LxValueType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;XsdType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XsdInt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MinOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MaxOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
            &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Int32&lt;/span&gt; &lt;span class="n"&gt;Id_Int_NO&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

            &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;A nullable &amp;lt;see cref="System.Int32" /&amp;gt;, Optional : null when not set&amp;lt;/summary&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxElementValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Quantity_Int_O"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"https://markpelf.com/SmallCompany.xsd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;LxValueType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;XsdType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XsdInt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MinOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MaxOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
            &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Int32&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="n"&gt;Quantity_Int_O&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="n"&gt;endregion&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is the class diagram.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwtnttlm0liz4w0m7qtye.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwtnttlm0liz4w0m7qtye.png" width="403" height="458"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6 Two C# API styles for Optional Xml-Elements
&lt;/h2&gt;

&lt;p&gt;There are two approaches/styles for marking Optional Xml-Element presence in generated C# code:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The first is &lt;strong&gt;bool_flag_style&lt;/strong&gt; – using a bool flag to indicate the presence of optional Xml-Element, with flag=false to indicate the Xml-Element was not present.
For example, for some Xml-Element &lt;strong&gt;&lt;em&gt;ElemA&lt;/em&gt;&lt;/strong&gt; that, if present, will have value integer, you will get in C# generated two variables “&lt;strong&gt;&lt;em&gt;bool ElemA_flag, int ElemA_value&lt;/em&gt;&lt;/strong&gt;”. You need to check if element &lt;strong&gt;&lt;em&gt;ElemA&lt;/em&gt;&lt;/strong&gt; was present by first checking the flag &lt;strong&gt;&lt;em&gt;ElemA_flag&lt;/em&gt;&lt;/strong&gt;; and then if it is true, you go for the value of &lt;strong&gt;&lt;em&gt;ElemA_value&lt;/em&gt;&lt;/strong&gt;. If you do not check flag &lt;strong&gt;&lt;em&gt;ElemA_flag&lt;/em&gt;&lt;/strong&gt; first, and just go for the value of &lt;strong&gt;&lt;em&gt;ElemA_value&lt;/em&gt;&lt;/strong&gt; you might pick the default int value of zero (0), and you can not know if that is just the default value for C# variable that is always present, but Xml-Element was not present, or that element was present and it actually had the value of zero (0).&lt;/li&gt;
&lt;li&gt;The second is &lt;strong&gt;nullable_type_style&lt;/strong&gt; – using a nullable type to indicate the presence of Xml-Element, with value=null to indicate the Xml-Element was not present.
For example, for some Xml-Element &lt;strong&gt;&lt;em&gt;ElemA&lt;/em&gt;&lt;/strong&gt; that, if present, will have value integer, you will get in C# generated variable “&lt;strong&gt;&lt;em&gt;int? ElemA_nullableValue&lt;/em&gt;&lt;/strong&gt;”. You need to check if element &lt;strong&gt;&lt;em&gt;ElemA&lt;/em&gt;&lt;/strong&gt; was present by first checking the &lt;strong&gt;&lt;em&gt;ElemA_nullableValue&lt;/em&gt;&lt;/strong&gt; not being null; and then if it is not meaning the element was present, you go for the int value of &lt;strong&gt;&lt;em&gt;ElemA_nullableValue&lt;/em&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  7 Sample C# app
&lt;/h2&gt;

&lt;p&gt;Here is a sample C# code using the above generated C# class to load and process the above presented XML SmallCompanyAAA.xml.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;ProcessVer4_Process1&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="n"&gt;filePath&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;Microsoft&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Extensions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ILogger&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="s"&gt;"+++ProcessVer4_Process1-Start++++++++++++++++++"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"filePath:"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;filePath&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="n"&gt;LxSerializer&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;XsdExample_Ver4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XSD1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Tns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SmallCompanyElm&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;serializer&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; 
            &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;LxSerializer&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;XsdExample_Ver4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XSD1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Tns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SmallCompanyElm&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;();&lt;/span&gt;
        &lt;span class="n"&gt;TextReader&lt;/span&gt; &lt;span class="n"&gt;textReader&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;File&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;OpenText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;filePath&lt;/span&gt; &lt;span class="p"&gt;??&lt;/span&gt; &lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Empty&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;LxReaderSettings&lt;/span&gt; &lt;span class="n"&gt;readerSettings&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;LxReaderSettings&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

        &lt;span class="n"&gt;XsdExample_Ver4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XSD1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Tns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SmallCompanyElm&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="n"&gt;xmlObject&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt;
            &lt;span class="n"&gt;serializer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Deserialize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;textReader&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;readerSettings&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;xmlObject&lt;/span&gt; &lt;span class="p"&gt;!=&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"CompanyName:"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;xmlObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CompanyName&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

            &lt;span class="k"&gt;foreach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;XsdExample_Ver4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XSD1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Tns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SmallCompanyElm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;EmployeeElm&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;xmlObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Employees&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"------------"&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Name_String_NO:"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Name_String_NO&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"City_String_O:"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;City_String_O&lt;/span&gt; &lt;span class="p"&gt;??&lt;/span&gt; &lt;span class="s"&gt;"null"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;

            &lt;span class="k"&gt;foreach&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;XsdExample_Ver4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XSD1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Tns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SmallCompanyElm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;InfoDataElm&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;xmlObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;InfoData&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"------------"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Id_Int_NO:"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Id_Int_NO&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ToString&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

                &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Quantity_Int_O:"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Quantity_Int_O&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;ToString&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;??&lt;/span&gt; &lt;span class="s"&gt;"null"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"xmlObject == null"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="s"&gt;"+++ProcessVer4_Process1-End++++++++++++++++++"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Exception&lt;/span&gt; &lt;span class="n"&gt;ex&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;methodName&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt;
            &lt;span class="s"&gt;$"Type: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Reflection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;MethodBase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;GetCurrentMethod&lt;/span&gt;&lt;span class="p"&gt;()?.&lt;/span&gt;&lt;span class="n"&gt;DeclaringType&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="n"&gt;FullName&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;, "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;
            &lt;span class="s"&gt;$"Method: ProcessVer4_Process1; "&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ex&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;methodName&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And here is the log of execution.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; +++ProcessVer4_Process1-Start++++++++++++++++++
 filePath:C:\TmpXSD\XsdExample_Ver4\Example01\bin\Debug\net8.0\XmlFiles\SmallCompanyAAA.xml
 CompanyName:SmallCompanyAAA
 ------------
 Name_String_NO:Mark
 City_String_O:Belgrade
 ------------
 Name_String_NO:John
 City_String_O:null
 ------------
 Id_Int_NO:11
 Quantity_Int_O:123
 ------------
 Id_Int_NO:22
 Quantity_Int_O:null
 +++ProcessVer4_Process1-End++++++++++++++++++

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  8 Analysis
&lt;/h2&gt;

&lt;p&gt;This tool uses “&lt;strong&gt;nullable_type_style&lt;/strong&gt;” approach/style to mark Optional Xml-Element presence in generated C# code.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Quantity_Int_O&lt;/strong&gt;– is int? type and the meaning is
a) null - means it was not present
b) int – present and had value&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  9 Conclusion
&lt;/h2&gt;

&lt;p&gt;This tool LiquidXMLObjects is very interesting but requires a &lt;strong&gt;commercial license&lt;/strong&gt;. The code generated looked solid in my test. It can be of great interest to users who want to use &lt;strong&gt;nullable_type_style&lt;/strong&gt; API, which is generally a more modern approach for handling the Optional Xml-Elements.  &lt;/p&gt;

&lt;p&gt;The full example code project can be downloaded at GitHub [99].&lt;/p&gt;

&lt;h2&gt;
  
  
  10 References
&lt;/h2&gt;

&lt;p&gt;[1] XML Schema&lt;br&gt;&lt;br&gt;
&lt;a href="https://www.w3schools.com/xml/xml_schema.asp" rel="noopener noreferrer"&gt;https://www.w3schools.com/xml/xml_schema.asp&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[2] The Difference Between Optional and Not Required&lt;br&gt;&lt;br&gt;
&lt;a href="https://www.infopathdev.com/blogs/greg/archive/2004/09/16/The-Difference-Between-Optional-and-Not-Required.aspx" rel="noopener noreferrer"&gt;https://www.infopathdev.com/blogs/greg/archive/2004/09/16/The-Difference-Between-Optional-and-Not-Required.aspx&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[3] nillable and minOccurs XSD element attributes&lt;br&gt;&lt;br&gt;
&lt;a href="https://stackoverflow.com/questions/1903062/nillable-and-minoccurs-xsd-element-attributes" rel="noopener noreferrer"&gt;https://stackoverflow.com/questions/1903062/nillable-and-minoccurs-xsd-element-attributes&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[99] &lt;a href="https://github.com/MarkPelf/XsdToolsInNet8" rel="noopener noreferrer"&gt;https://github.com/MarkPelf/XsdToolsInNet8&lt;/a&gt; &lt;/p&gt;

</description>
      <category>csharp</category>
      <category>xml</category>
      <category>xsd</category>
    </item>
    <item>
      <title>XSD Tools in .NET8 – Part8 – LinqToXsdCore - Advanced</title>
      <dc:creator>Mark Pelf</dc:creator>
      <pubDate>Fri, 08 Nov 2024 12:57:12 +0000</pubDate>
      <link>https://dev.to/markpelf/xsd-tools-in-net8-part8-linqtoxsdcore-advanced-2fem</link>
      <guid>https://dev.to/markpelf/xsd-tools-in-net8-part8-linqtoxsdcore-advanced-2fem</guid>
      <description>&lt;p&gt;A practical guide to XSD tools available in .NET8 environment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Abstract: A practical guide to XML and XSD tools available in .NET8 environment, focusing on generating and using C# classes to process some XML valid for some given XSD (technology as of September 2024).&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1 Doing XML and XSD related work in .NET8
&lt;/h2&gt;

&lt;p&gt;I was recently doing some work related to XML and XSD processing in .NET8 environment and created several &lt;strong&gt;&lt;em&gt;proof-of-concept applications&lt;/em&gt;&lt;/strong&gt; to evaluate the tools available. These articles are the result of my &lt;strong&gt;&lt;em&gt;prototyping work&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  1.1 List of tools used/tested
&lt;/h3&gt;

&lt;p&gt;Here are the tools used/tested:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Visual Studio 2022&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;XSD.EXE&lt;/strong&gt; (Microsoft license, part of VS2022)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;XmlSchemaClassGenerator&lt;/strong&gt; (Open Source/Freeware)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LinqToXsdCore&lt;/strong&gt; (Open Source/Freeware)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Liquid XML Objects&lt;/strong&gt; (Commercial license)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  1.2 Articles in this series
&lt;/h3&gt;

&lt;p&gt;For technical reasons, I will organize this text into several articles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;XSD Tools in .NET8 – Part1 – VS2022&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;XSD Tools in .NET8 – Part2 – C# validation&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;XSD Tools in .NET8 – Part3 – XsdExe – Simple&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;XSD Tools in .NET8 – Part4 – XsdExe - Advanced&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;XSD Tools in .NET8 – Part5 – XmlSchemaClassGenerator – Simple&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;XSD Tools in .NET8 – Part6 – XmlSchemaClassGenerator – Advanced&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;XSD Tools in .NET8 – Part7 – LinqToXsdCore – Simple&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;XSD Tools in .NET8 – Part8 – LinqToXsdCore – Advanced&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;XSD Tools in .NET8 – Part9 – LiquidXMLObjects – Simple&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;em&gt;XSD Tools in .NET8 – Part10 – LiquidXMLObjects – Advanced&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2 More theory about XML and XSD rules
&lt;/h2&gt;

&lt;p&gt;Here is some more theory about XML and XSD rules.&lt;/p&gt;

&lt;h3&gt;
  
  
  2.1 Optional Xml-Element and Xml-Attribute
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Optional&lt;/strong&gt;: Does not need to be present in the XML.&lt;/p&gt;

&lt;p&gt;For XSD Schema elements:&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Optional&lt;/strong&gt;: minOccurs="0" attribute -&amp;gt;In order to set a schema element as optional, you include the minOccurs="0" attribute&lt;/p&gt;
&lt;h3&gt;
  
  
  2.2 The Difference Between Optional and Not Required for Xml-Element and Xml-Attribute
&lt;/h3&gt;

&lt;p&gt;Note the difference:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Optional&lt;/strong&gt;: Does not need to be present in the XML.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not Required&lt;/strong&gt;: Does not need to have a value.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can have any combination:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Optional + Not Required&lt;/li&gt;
&lt;li&gt;Optional + Required&lt;/li&gt;
&lt;li&gt;Not Optional + Not Required&lt;/li&gt;
&lt;li&gt;Not Optional + Required&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For XSD Schema elements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Optional&lt;/strong&gt;: minOccurs="0" attribute -&amp;gt;In order to set a schema element as optional, you include the minOccurs="0" attribute&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Required&lt;/strong&gt;: nillable="true" attribute -&amp;gt;In order to set a schema element as not required, you include the nillable="true" attribute.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;String data types are not required by default, though you can force them to be required.&lt;br&gt;&lt;br&gt;
Other data types, such as Boolean, Integer, Date, Time, etc. are all required by default. In order to make one of these data types not required, you must set the nillable attribute equal to true for the element in the schema.&lt;/p&gt;
&lt;h2&gt;
  
  
  3 Examples of XML and XSD
&lt;/h2&gt;

&lt;p&gt;Here are some sample XML-s and XSD-s I created for test purposes.&lt;/p&gt;
&lt;h3&gt;
  
  
  3.1 Advanced case
&lt;/h3&gt;

&lt;p&gt;Please note that this example XML/XSD has an &lt;strong&gt;&lt;em&gt;Optional and Not-Required Xml-Element&lt;/em&gt;&lt;/strong&gt;. Read the comments inside for more details.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!--SmallCompany.xsd++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;xs:schema&lt;/span&gt; &lt;span class="na"&gt;attributeFormDefault=&lt;/span&gt;&lt;span class="s"&gt;"unqualified"&lt;/span&gt; 
           &lt;span class="na"&gt;elementFormDefault=&lt;/span&gt;&lt;span class="s"&gt;"qualified"&lt;/span&gt; 
           &lt;span class="na"&gt;targetNamespace=&lt;/span&gt;&lt;span class="s"&gt;"https://markpelf.com/SmallCompany.xsd"&lt;/span&gt; 
           &lt;span class="na"&gt;xmlns:xs=&lt;/span&gt;&lt;span class="s"&gt;"http://www.w3.org/2001/XMLSchema"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"SmallCompany"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;xs:complexType&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;xs:sequence&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"CompanyName"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"xs:string"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;maxOccurs=&lt;/span&gt;&lt;span class="s"&gt;"unbounded"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"Employee"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;xs:complexType&amp;gt;&lt;/span&gt;
                        &lt;span class="nt"&gt;&amp;lt;xs:sequence&amp;gt;&lt;/span&gt;
                            &lt;span class="c"&gt;&amp;lt;!--Name_String_NO is String NotOptional--&amp;gt;&lt;/span&gt;
                            &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"Name_String_NO"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"xs:string"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
                            &lt;span class="c"&gt;&amp;lt;!--City_String_O is String Optional--&amp;gt;&lt;/span&gt;
                            &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;minOccurs=&lt;/span&gt;&lt;span class="s"&gt;"0"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"City_String_O"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"xs:string"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span class="nt"&gt;&amp;lt;/xs:sequence&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;/xs:complexType&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;/xs:element&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;maxOccurs=&lt;/span&gt;&lt;span class="s"&gt;"unbounded"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"InfoData"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;xs:complexType&amp;gt;&lt;/span&gt;
                        &lt;span class="nt"&gt;&amp;lt;xs:sequence&amp;gt;&lt;/span&gt;
                            &lt;span class="c"&gt;&amp;lt;!--Id_Int_NO is Int NotOptional--&amp;gt;&lt;/span&gt;
                            &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"Id_Int_NO"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"xs:int"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
                            &lt;span class="c"&gt;&amp;lt;!--Quantity_Int_O is Int Optional--&amp;gt;&lt;/span&gt;
                            &lt;span class="nt"&gt;&amp;lt;xs:element&lt;/span&gt; &lt;span class="na"&gt;minOccurs=&lt;/span&gt;&lt;span class="s"&gt;"0"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"Quantity_Int_O"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"xs:int"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
                        &lt;span class="nt"&gt;&amp;lt;/xs:sequence&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;/xs:complexType&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;/xs:element&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;/xs:sequence&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/xs:complexType&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/xs:element&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/xs:schema&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!--SmallCompanyAAA.xml+++++++++++++++++++++++++++++++++++++++++++++++--&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;SmallCompany&lt;/span&gt; &lt;span class="na"&gt;xmlns=&lt;/span&gt;&lt;span class="s"&gt;"https://markpelf.com/SmallCompany.xsd"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;CompanyName&amp;gt;&lt;/span&gt;SmallCompanyAAA&lt;span class="nt"&gt;&amp;lt;/CompanyName&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;Employee&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;Name_String_NO&amp;gt;&lt;/span&gt;Mark&lt;span class="nt"&gt;&amp;lt;/Name_String_NO&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;City_String_O&amp;gt;&lt;/span&gt;Belgrade&lt;span class="nt"&gt;&amp;lt;/City_String_O&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/Employee&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;Employee&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;Name_String_NO&amp;gt;&lt;/span&gt;John&lt;span class="nt"&gt;&amp;lt;/Name_String_NO&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/Employee&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;InfoData&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;Id_Int_NO&amp;gt;&lt;/span&gt;11&lt;span class="nt"&gt;&amp;lt;/Id_Int_NO&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;Quantity_Int_O&amp;gt;&lt;/span&gt;123&lt;span class="nt"&gt;&amp;lt;/Quantity_Int_O&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/InfoData&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;InfoData&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;Id_Int_NO&amp;gt;&lt;/span&gt;22&lt;span class="nt"&gt;&amp;lt;/Id_Int_NO&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/InfoData&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/SmallCompany&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Using LinqToXsdCore tool to create C# class
&lt;/h2&gt;

&lt;p&gt;We focus in this article on the usage of LinqToXsdCore tool to generate C# class from XSD file.&lt;br&gt;&lt;br&gt;
Here is the tool's basic info.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
Tool name:  ============================
Liquid XML Objects

License============================ 
2 licenses:
1) Free Community Edition: Home Users and Students, XML Schema (size limited)
2) Commercial Product, Developer Bundle (Installed) $770.94 (perpetual license)

Where to get it============================
https://www.liquid-technologies.com/xml-objects

Install Instructions====================================
-a free trial which will expire 15 days after activation, after this time the product will continue to operate as the Free Community Edition.

Version============================
Liquid Studio - Community Edition 20.7.14.13112

Help============================
https://www.liquid-technologies.com/Reference/XmlDataBinding/xml-objects-introduction.html
====================================================    
Usage Examples===================                         
Instructions to generate C# class 
Using GUI - context right click on .xsd file
====================================


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5 Generated C# class
&lt;/h2&gt;

&lt;p&gt;Here is the C# generated by the above tool based on the above presented XSD BigCompany.xsd.&lt;/p&gt;

&lt;p&gt;The class's full code produced by this tool is big (835 lines), so I will here show just the beginning of the file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;///////////////////////////////////////////////////////////////////////////&lt;/span&gt;
&lt;span class="c1"&gt;//           Liquid XML Objects GENERATED CODE - DO NOT MODIFY           //&lt;/span&gt;
&lt;span class="c1"&gt;//            https://www.liquid-technologies.com/xml-objects            //&lt;/span&gt;
&lt;span class="c1"&gt;//=======================================================================//&lt;/span&gt;
&lt;span class="c1"&gt;// Dependencies                                                          //&lt;/span&gt;
&lt;span class="c1"&gt;//     Nuget : LiquidTechnologies.XmlObjects.Runtime                     //&lt;/span&gt;
&lt;span class="c1"&gt;//           : MUST BE VERSION 20.7.14                                   //&lt;/span&gt;
&lt;span class="c1"&gt;//=======================================================================//&lt;/span&gt;
&lt;span class="c1"&gt;// Online Help                                                           //&lt;/span&gt;
&lt;span class="c1"&gt;//     https://www.liquid-technologies.com/xml-objects-quick-start-guide //&lt;/span&gt;
&lt;span class="c1"&gt;//=======================================================================//&lt;/span&gt;
&lt;span class="c1"&gt;// Licensing Information                                                 //&lt;/span&gt;
&lt;span class="c1"&gt;//     https://www.liquid-technologies.com/eula                          //&lt;/span&gt;
&lt;span class="c1"&gt;///////////////////////////////////////////////////////////////////////////&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System.ComponentModel&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System.Collections.Generic&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System.Linq&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System.Xml.Linq&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System.Numerics&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;LiquidTechnologies.XmlObjects&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;LiquidTechnologies.XmlObjects.Attribution&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// ------------------------------------------------------&lt;/span&gt;
&lt;span class="c1"&gt;// |                      Settings                      |&lt;/span&gt;
&lt;span class="c1"&gt;// ------------------------------------------------------&lt;/span&gt;
&lt;span class="c1"&gt;// GenerateCommonBaseClass                  = False&lt;/span&gt;
&lt;span class="c1"&gt;// GenerateUnprocessedNodeHandlers          = False&lt;/span&gt;
&lt;span class="c1"&gt;// RaiseChangeEvents                        = False&lt;/span&gt;
&lt;span class="c1"&gt;// CollectionNaming                         = Pluralize&lt;/span&gt;
&lt;span class="c1"&gt;// Language                                 = CS&lt;/span&gt;
&lt;span class="c1"&gt;// OutputNamespace                          = XsdExample_Ver4.XSD1&lt;/span&gt;
&lt;span class="c1"&gt;// WriteDefaultValuesForOptionalAttributes  = True&lt;/span&gt;
&lt;span class="c1"&gt;// WriteDefaultValuesForOptionalElements    = True&lt;/span&gt;
&lt;span class="c1"&gt;// MixedContentHandling                     = TreatAsAny&lt;/span&gt;
&lt;span class="c1"&gt;// GenerationModel                          = Simple&lt;/span&gt;
&lt;span class="c1"&gt;//                                            *WARNING* this simplified model that is very easy to work with&lt;/span&gt;
&lt;span class="c1"&gt;//                                            but may cause the XML to be produced without regard for element&lt;/span&gt;
&lt;span class="c1"&gt;//                                            cardinality or order. Where very high compliance with the XML Schema&lt;/span&gt;
&lt;span class="c1"&gt;//                                            standard is required use GenerationModelType.Conformant&lt;/span&gt;
&lt;span class="c1"&gt;// XSD Schema Files&lt;/span&gt;
&lt;span class="c1"&gt;//    C:\TmpXSD\XsdExample_Ver4\Example01\XSD1\SmallCompany.xsd&lt;/span&gt;


&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;XsdExample_Ver4.XSD1&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="n"&gt;region&lt;/span&gt; &lt;span class="n"&gt;Global&lt;/span&gt; &lt;span class="n"&gt;Settings&lt;/span&gt;
    &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;Contains library level properties, and ensures the version of the runtime used matches the version used to generate it.&amp;lt;/summary&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxRuntimeRequirements&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"20.7.14.13112"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Free Community Edition"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"M9WDQLWDQNEEVNLX"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;LiquidTechnologies&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XmlObjects&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;LicenseTermsType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CommunityEdition&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;partial&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;LxRuntimeRequirementsWritten&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="n"&gt;endregion&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;XsdExample_Ver4.XSD1.Xs&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="n"&gt;region&lt;/span&gt; &lt;span class="n"&gt;Complex&lt;/span&gt; &lt;span class="n"&gt;Types&lt;/span&gt;
    &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;A class representing the root XSD complexType anyType@http://www.w3.org/2001/XMLSchema&amp;lt;/summary&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxSimpleComplexTypeDefinition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"anyType"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"http://www.w3.org/2001/XMLSchema"&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;partial&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;AnyTypeCt&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;XElement&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;Constructor : create a &amp;lt;see cref="AnyTypeCt" /&amp;gt; element &amp;amp;lt;anyType xmlns='http://www.w3.org/2001/XMLSchema'&amp;amp;gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="nf"&gt;AnyTypeCt&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;base&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;XName&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"anyType"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"http://www.w3.org/2001/XMLSchema"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="n"&gt;endregion&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;XsdExample_Ver4.XSD1.Tns&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="n"&gt;region&lt;/span&gt; &lt;span class="n"&gt;Elements&lt;/span&gt;
    &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;A class representing the root XSD element SmallCompany@https://markpelf.com/SmallCompany.xsd&amp;lt;/summary&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxSimpleElementDefinition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"SmallCompany"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"https://markpelf.com/SmallCompany.xsd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ElementScopeType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;GlobalElement&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;partial&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SmallCompanyElm&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;A &amp;lt;see cref="System.String" /&amp;gt;, Required : should not be set to null&amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxElementValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"CompanyName"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"https://markpelf.com/SmallCompany.xsd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;LxValueType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;XsdType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XsdString&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MinOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MaxOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;String&lt;/span&gt; &lt;span class="n"&gt;CompanyName&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;A collection of &amp;lt;see cref="XsdExample_Ver4.XSD1.Tns.SmallCompanyElm.EmployeeElm" /&amp;gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxElementRef&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MinOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MaxOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;LxConstants&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Unbounded&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;XsdExample_Ver4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XSD1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Tns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SmallCompanyElm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;EmployeeElm&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;Employees&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;XsdExample_Ver4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XSD1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Tns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SmallCompanyElm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;EmployeeElm&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;();&lt;/span&gt;

        &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;A collection of &amp;lt;see cref="XsdExample_Ver4.XSD1.Tns.SmallCompanyElm.InfoDataElm" /&amp;gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxElementRef&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MinOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MaxOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;LxConstants&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Unbounded&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;XsdExample_Ver4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XSD1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Tns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SmallCompanyElm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;InfoDataElm&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;InfoData&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;XsdExample_Ver4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XSD1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Tns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SmallCompanyElm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;InfoDataElm&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;();&lt;/span&gt;

        &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;Represent the inline xs:element Employee@https://markpelf.com/SmallCompany.xsd.&amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxSimpleElementDefinition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Employee"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"https://markpelf.com/SmallCompany.xsd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ElementScopeType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;InlineElement&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;partial&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;EmployeeElm&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;A &amp;lt;see cref="System.String" /&amp;gt;, Required : should not be set to null&amp;lt;/summary&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxElementValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Name_String_NO"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"https://markpelf.com/SmallCompany.xsd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;LxValueType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;XsdType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XsdString&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MinOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MaxOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
            &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;String&lt;/span&gt; &lt;span class="n"&gt;Name_String_NO&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

            &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;A &amp;lt;see cref="System.String" /&amp;gt;, Optional : null when not set&amp;lt;/summary&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxElementValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"City_String_O"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"https://markpelf.com/SmallCompany.xsd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;LxValueType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;XsdType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XsdString&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MinOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MaxOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
            &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="n"&gt;City_String_O&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;Represent the inline xs:element InfoData@https://markpelf.com/SmallCompany.xsd.&amp;lt;/summary&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxSimpleElementDefinition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"InfoData"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"https://markpelf.com/SmallCompany.xsd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ElementScopeType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;InlineElement&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;partial&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;InfoDataElm&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;A &amp;lt;see cref="System.Int32" /&amp;gt;, Required&amp;lt;/summary&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxElementValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Id_Int_NO"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"https://markpelf.com/SmallCompany.xsd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;LxValueType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;XsdType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XsdInt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MinOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MaxOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
            &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Int32&lt;/span&gt; &lt;span class="n"&gt;Id_Int_NO&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

            &lt;span class="c1"&gt;/// &amp;lt;summary&amp;gt;A nullable &amp;lt;see cref="System.Int32" /&amp;gt;, Optional : null when not set&amp;lt;/summary&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;LxElementValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Quantity_Int_O"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"https://markpelf.com/SmallCompany.xsd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;LxValueType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;XsdType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XsdInt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MinOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MaxOccurs&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
            &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Int32&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="n"&gt;Quantity_Int_O&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="n"&gt;endregion&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is the class diagram.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2jometkt5jbu38fs9inb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2jometkt5jbu38fs9inb.png" width="499" height="1022"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The generated class requires very specific dependencies installed in support.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx8e5plngte6cpbf78iwl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx8e5plngte6cpbf78iwl.png" width="724" height="303"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6 Two C# API styles for Optional Xml-Elements
&lt;/h2&gt;

&lt;p&gt;There are two approaches/styles for marking Optional Xml-Element presence in generated C# code:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The first is &lt;strong&gt;bool_flag_style&lt;/strong&gt; – using a bool flag to indicate the presence of optional Xml-Element, with flag=false to indicate the Xml-Element was not present.
For example, for some Xml-Element &lt;strong&gt;&lt;em&gt;ElemA&lt;/em&gt;&lt;/strong&gt; that, if present, will have value integer, you will get in C# generated two variables “&lt;strong&gt;&lt;em&gt;bool ElemA_flag, int ElemA_value&lt;/em&gt;&lt;/strong&gt;”. You need to check if element &lt;strong&gt;&lt;em&gt;ElemA&lt;/em&gt;&lt;/strong&gt; was present by first checking the flag &lt;strong&gt;&lt;em&gt;ElemA_flag&lt;/em&gt;&lt;/strong&gt;; and then if it is true, you go for the value of &lt;strong&gt;&lt;em&gt;ElemA_value&lt;/em&gt;&lt;/strong&gt;. If you do not check flag &lt;strong&gt;&lt;em&gt;ElemA_flag&lt;/em&gt;&lt;/strong&gt; first, and just go for the value of &lt;strong&gt;&lt;em&gt;ElemA_value&lt;/em&gt;&lt;/strong&gt; you might pick the default int value of zero (0), and you can not know if that is just the default value for C# variable that is always present, but Xml-Element was not present, or that element was present and it actually had the value of zero (0).&lt;/li&gt;
&lt;li&gt;The second is &lt;strong&gt;nullable_type_style&lt;/strong&gt; – using a nullable type to indicate the presence of Xml-Element, with value=null to indicate the Xml-Element was not present.
For example, for some Xml-Element &lt;strong&gt;&lt;em&gt;ElemA&lt;/em&gt;&lt;/strong&gt; that, if present, will have value integer, you will get in C# generated variable “&lt;strong&gt;&lt;em&gt;int? ElemA_nullableValue&lt;/em&gt;&lt;/strong&gt;”. You need to check if element &lt;strong&gt;&lt;em&gt;ElemA&lt;/em&gt;&lt;/strong&gt; was present by first checking the &lt;strong&gt;&lt;em&gt;ElemA_nullableValue&lt;/em&gt;&lt;/strong&gt; not being null; and then if it is not meaning the element was present, you go for the int value of &lt;strong&gt;&lt;em&gt;ElemA_nullableValue&lt;/em&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  7 Sample C# app
&lt;/h2&gt;

&lt;p&gt;Here is a sample C# code using the above generated C# class to load and process the above presented XML BigCompanyMMM.xml.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;ProcessVer4_Process1&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="n"&gt;filePath&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;Microsoft&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Extensions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Logging&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ILogger&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="s"&gt;"+++ProcessVer4_Process1-Start++++++++++++++++++"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"filePath:"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;filePath&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="n"&gt;LxSerializer&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;XsdExample_Ver4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XSD1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Tns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SmallCompanyElm&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;serializer&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; 
            &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;LxSerializer&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;XsdExample_Ver4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XSD1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Tns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SmallCompanyElm&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;();&lt;/span&gt;
        &lt;span class="n"&gt;TextReader&lt;/span&gt; &lt;span class="n"&gt;textReader&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;File&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;OpenText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;filePath&lt;/span&gt; &lt;span class="p"&gt;??&lt;/span&gt; &lt;span class="n"&gt;String&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Empty&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;LxReaderSettings&lt;/span&gt; &lt;span class="n"&gt;readerSettings&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;LxReaderSettings&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

        &lt;span class="n"&gt;XsdExample_Ver4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XSD1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Tns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SmallCompanyElm&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="n"&gt;xmlObject&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt;
            &lt;span class="n"&gt;serializer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Deserialize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;textReader&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;readerSettings&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;xmlObject&lt;/span&gt; &lt;span class="p"&gt;!=&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"CompanyName:"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;xmlObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CompanyName&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

            &lt;span class="k"&gt;foreach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;XsdExample_Ver4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XSD1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Tns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SmallCompanyElm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;EmployeeElm&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;xmlObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Employees&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"------------"&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Name_String_NO:"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Name_String_NO&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"City_String_O:"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;City_String_O&lt;/span&gt; &lt;span class="p"&gt;??&lt;/span&gt; &lt;span class="s"&gt;"null"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;

            &lt;span class="k"&gt;foreach&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;XsdExample_Ver4&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;XSD1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Tns&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SmallCompanyElm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;InfoDataElm&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;xmlObject&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;InfoData&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"------------"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Id_Int_NO:"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Id_Int_NO&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ToString&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

                &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Quantity_Int_O:"&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Quantity_Int_O&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;ToString&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;??&lt;/span&gt; &lt;span class="s"&gt;"null"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"xmlObject == null"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogInformation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="s"&gt;"+++ProcessVer4_Process1-End++++++++++++++++++"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Exception&lt;/span&gt; &lt;span class="n"&gt;ex&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;methodName&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt;
            &lt;span class="s"&gt;$"Type: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Reflection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;MethodBase&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;GetCurrentMethod&lt;/span&gt;&lt;span class="p"&gt;()?.&lt;/span&gt;&lt;span class="n"&gt;DeclaringType&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="n"&gt;FullName&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;, "&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt;
            &lt;span class="s"&gt;$"Method: ProcessVer4_Process1; "&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nf"&gt;LogError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ex&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;methodName&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And here is the log of execution.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; +++ProcessVer4_Process1-Start++++++++++++++++++
 filePath:C:\TmpXSD\XsdExample_Ver4\Example01\bin\Debug\net8.0\XmlFiles\SmallCompanyAAA.xml
 CompanyName:SmallCompanyAAA
 ------------
 Name_String_NO:Mark
 City_String_O:Belgrade
 ------------
 Name_String_NO:John
 City_String_O:null
 ------------
 Id_Int_NO:11
 Quantity_Int_O:123
 ------------
 Id_Int_NO:22
 Quantity_Int_O:null
 +++ProcessVer4_Process1-End++++++++++++++++++

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  8 Analysis
&lt;/h2&gt;

&lt;p&gt;This tool uses “&lt;strong&gt;nullable_type_style&lt;/strong&gt;” approach/style to mark Optional Xml-Element presence in generated C# code. It does not try to indicate a special case of &lt;strong&gt;“nill”.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Data1_Int_NO_R&lt;/strong&gt; - is int type and always has value&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data2_Int_NO_NR&lt;/strong&gt; - is int? type and the meaning is:
a) null – present but &lt;strong&gt;“nill”&lt;/strong&gt; (we have null here even if the element was present but the value was &lt;strong&gt;“nill”&lt;/strong&gt;)
b) int – present and had value&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data3_Int_O_R&lt;/strong&gt; – is int? type and the meaning is
a) null - means it was not present
b) int – present and had value&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data4_Int_O_NR&lt;/strong&gt; - is int? type and the meaning is
a) null – means it either was not present or present but &lt;strong&gt;“nill”&lt;/strong&gt;. We can not know which of these 2 cases happened. Strictly speaking, that is a deficiency of this approach/code generated. In some cases, such a distinction might be needed.
b) int – present and had value&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is interesting to look at this tool regarding the ability in the case of Xml-Element &lt;strong&gt;Data4_Int_O_NR&lt;/strong&gt; to indicate all three states: “not-present”, “present-nill”, “present-int”. I do not see that using the modern API style/approach “&lt;strong&gt;nullable_type_style&lt;/strong&gt;” the that can be achieved. If &lt;strong&gt;Data4_Int_O_NR&lt;/strong&gt; is null, we can not know if it was “not-present” or “present-nill”.&lt;/p&gt;

&lt;h2&gt;
  
  
  9 Conclusion
&lt;/h2&gt;

&lt;p&gt;This tool LinqToXsdCore is very interesting and available as freeware. Code C# class generated was very big (it includes some extra methods like Load, Save, Clone), but worked solid in my test. The issue is only that “nillable” option is not handled well at all. Theoretically, that is a problem and for some users, it can be important, if they want a tool that follows all XML specifications.&lt;br&gt;&lt;br&gt;
It can be of interest to users who want to use &lt;strong&gt;nullable_type_style&lt;/strong&gt; API, which is generally a more modern approach to handling the Optional Xml-Elements.&lt;/p&gt;

&lt;p&gt;Some things make me a bit reserved about using this tool, like why the generated class is so big. Even more than that is the question of those very specific dependencies libraries, are they maintained, and reliable, and will they cause any conflicts with other XML libraries? Answers to these questions would require more studying of this tool before deciding whether to use it in production.  &lt;/p&gt;

&lt;p&gt;The full example code project can be downloaded at GitHub [99].&lt;/p&gt;

&lt;h2&gt;
  
  
  10 References
&lt;/h2&gt;

&lt;p&gt;[1] XML Schema&lt;br&gt;&lt;br&gt;
&lt;a href="https://www.w3schools.com/xml/xml_schema.asp" rel="noopener noreferrer"&gt;https://www.w3schools.com/xml/xml_schema.asp&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[2] The Difference Between Optional and Not Required&lt;br&gt;&lt;br&gt;
&lt;a href="https://www.infopathdev.com/blogs/greg/archive/2004/09/16/The-Difference-Between-Optional-and-Not-Required.aspx" rel="noopener noreferrer"&gt;https://www.infopathdev.com/blogs/greg/archive/2004/09/16/The-Difference-Between-Optional-and-Not-Required.aspx&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[3] nillable and minOccurs XSD element attributes&lt;br&gt;&lt;br&gt;
&lt;a href="https://stackoverflow.com/questions/1903062/nillable-and-minoccurs-xsd-element-attributes" rel="noopener noreferrer"&gt;https://stackoverflow.com/questions/1903062/nillable-and-minoccurs-xsd-element-attributes&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[99] &lt;a href="https://github.com/MarkPelf/XsdToolsInNet8" rel="noopener noreferrer"&gt;https://github.com/MarkPelf/XsdToolsInNet8&lt;/a&gt; &lt;/p&gt;

</description>
      <category>csharp</category>
      <category>xml</category>
      <category>xsd</category>
    </item>
  </channel>
</rss>
