

- Automatically generateboilerplate text clipboard install#
- Automatically generateboilerplate text clipboard code#
- Automatically generateboilerplate text clipboard download#
Automatically generateboilerplate text clipboard code#
This code won’t show all the elements with minimum age. Now, with MinBy and MaxBy you don’t have to use the IComparable and can use something like: var minByAge = people.MinBy(p => p.Age) That posed a problem, especially if the class you wanted to compare didn’t implement the IComparable interface. When using the methods Max and Min, the sequences should implement the IComparable interface, so they could be compared and the maximum and minimum evaluated. If you want to include them, you should use: var people6 = people.Where(p => includedAges.Contains(p.Age)) MaxBy and MinBy In the same way of the ExceptBy, the duplicates are not included. Var people5 = people.IntersectBy(includedAges, p => p.Age) Index and Ranges were introduced in C#8, they can ease a lot when you must get a subrange of an array or list: var arr = Enumerable.Range(1,100).ToArray() Ĭonsole.WriteLine($"[ These new features came with no huge announcements, but, nevertheless, they are very nice improvements. Microsoft heard that and introduced new features, many of them I was expecting since a long time. The features available in LINQ made my code more synthetic and readable, but sometimes, there was something that wasn’t easily attained with the default features. With that, working with data was simplified a lot and, when I go to a language that doesn’t have something like it, I feel lost (having to deal with for and foreach became painful for me :-). You can use it as a notebook for you, as a learning tool, as a prototype tool, or even as a tool for sharing knowledge.Ī nice improvement in.
Automatically generateboilerplate text clipboard download#
I even created the notebook for this article (you can download it at ) based on my last article, about Linq in.

Var suppliers = JsonConvert.DeserializeObject>(suppliersJson) Īs you can see there are multiple possibilities. Public record Supplier(string Id, string CompanyName, string ContactName, string ContactTitle, Address Address) Public record Address(string Street, string City, string Region, string PostalCode, string Country, string Phone) Then we can show the data as C# classes with: #!share -from value suppliersJson For example, we can get the suppliers dataset as a Json file from the url “”, with this code: #!value -from-url -name suppliersJson You can also use Nuget packages with the #r directive. HousingData.ExploreWithSandDance().Display() Var housingData = DataFrame.LoadCsv(housingPath) Once you have the data, you can display it with SandDance, with this code: using You can get some data from an URL, using the command #!value -from-url -name housingPath If you want to use javascript, you can use something like: If you add !#fsharp in the first line, you can add F# code, like in: You can even mix languages in the notebook. If you want to display more than a single value, you can use the display function, like in To display the values, you can use Console.WriteLineor simply declare a variable and put it in a single line like in You can run the code by clicking the arrow icon next to the cell or by pressing the Ctrl+Alt+Enter keys. The markdown cells have text formatted with the Markdown syntax and the code cells can have code, in the selected language. When you create a new notebook, you can add markdown or code cells. NET Interactive: Open Notebook and open the existing notebook. If you want to open an existing notebook, just press Ctrl+Shift+P and select. Just press Ctrl+Shift+Alt+N and open a new notebook (you can choose C#, F# or even Powershell as the default language) and a new notebook is ready to use.
Automatically generateboilerplate text clipboard install#
Its use is very simple: just install the >NET Interactive extension in VS Code and you’re ready to go.

With it, you can create interactive notebooks and create interactive pieces of code, where you can share and try sample code. And a new feature has appeared to document your code. NET 6 and C#10 are here, Visual Studio Code is a nice environment for editing your code, and you can even edit your code in the web. This is a wonderful tool to document your code but, since then, a lot has changed. Sometime ago I posted an article about Dotnet Try.
