Basics of C# Archives - {coding}Sight https://codingsight.com/category/languages-coding/basics-of-c/ Blog for SQL Server DBAs and Developers Mon, 13 Mar 2023 12:45:57 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.2 https://codingsight.com/wp-content/uploads/2021/10/cropped-Soсial_-Fb_180х180-1-32x32.png Basics of C# Archives - {coding}Sight https://codingsight.com/category/languages-coding/basics-of-c/ 32 32 LINQ to Entities – Tutorial with Examples https://codingsight.com/introducing-linq-to-entities/ Wed, 03 Aug 2022 07:54:00 +0000 http://codingsight.com/?p=14805 When we think about querying databases, the first thing that pops to mind is usually some SQL query. Then other questions arise in regards to the database type, connection, query design, etc. LINQ to Entities combined with Entity Framework allows the developers to skip a big portion of these questions and worries. Entity Framework handles …

The post LINQ to Entities – Tutorial with Examples appeared first on {coding}Sight.

]]>
LINQ in C#: A tutorial with Query Examples in LINQ to Objects https://codingsight.com/what-is-linq-in-c-sharp/ Thu, 22 Apr 2021 12:55:53 +0000 http://codingsight.com/?p=12808 Less is more – this is definitely true when it comes to object collections and LINQ queries. One of the most valuable advantages is the ability to write cleaner and more concise code, thus accomplishing more with fewer lines. The current article will introduce the basic understanding of LINQ technologies and present alternatives to the …

The post LINQ in C#: A tutorial with Query Examples in LINQ to Objects appeared first on {coding}Sight.

]]>
Functional F# that slowly appears in C# https://codingsight.com/functional-f-that-slowly-appears-in-c/ https://codingsight.com/functional-f-that-slowly-appears-in-c/#comments Mon, 18 Dec 2017 10:28:26 +0000 http://codingsight.com/?p=2922 For some reason, we often do not use this functionality. Maybe we haven’t got used to it yet. And sometimes we use it, having no idea that this is the functionality from F#. Before reviewing it, let’s quickly run through the most interesting features that appeared in different versions of the language. Note that each time …

The post Functional F# that slowly appears in C# appeared first on {coding}Sight.

]]>
https://codingsight.com/functional-f-that-slowly-appears-in-c/feed/ 1
Sending a Query to All Databases of All Specified Servers in MS SQL Server and C#.NET https://codingsight.com/sending-a-query-to-all-databases-of-all-specified-servers-in-ms-sql-server-and-c-net/ Wed, 15 Nov 2017 09:24:08 +0000 http://codingsight.com/?p=2680 Often, it is necessary to send a query to all databases of all specified servers. Many DML-queries can be created with built-in tools. However, what about DDL-queries? In this article, we are going to explore an example of implementing the application that sends a query to all databases of all specified servers, using MS SQL …

The post Sending a Query to All Databases of All Specified Servers in MS SQL Server and C#.NET appeared first on {coding}Sight.

]]>
Tricky Questions about C# https://codingsight.com/tricky-questions-about-c-sharp/ https://codingsight.com/tricky-questions-about-c-sharp/#comments Tue, 24 Oct 2017 11:31:09 +0000 http://codingsight.com/?p=2464 Some questions may seem too basic, but they still contain tiny tricks. Sometimes even a simple question may nail to the wall. These questions will be useful to all who study the language. So, let’s start! 1. What will be the result of execution of the following code? 2. Let’s play with inheritance. What will …

The post Tricky Questions about C# appeared first on {coding}Sight.

]]>
https://codingsight.com/tricky-questions-about-c-sharp/feed/ 3
Preparing for Exam 70-483: Programming in C# https://codingsight.com/preparing-for-exam-70-483-programming-in-c/ Mon, 09 Oct 2017 07:12:44 +0000 http://codingsight.com/?p=2348 During preparation for exam 70-483, I found lots of websites containing links to various manuals that helped me a lot. But what really helped me was the memo notes I composed for myself and which I’d like to share in this article. I do not target to provide a detailed description of C#, I just …

The post Preparing for Exam 70-483: Programming in C# appeared first on {coding}Sight.

]]>
How to Use Signals in C# https://codingsight.com/signals-in-c/ Mon, 11 Sep 2017 09:16:51 +0000 http://codingsight.com/?p=2190   Currently, the thread synchronization in С# causes some difficulties, in particular, when passing synchronization primitives between the objects of your application and supporting them in the future. The current model with Task and IAsyncResult, as well as with TPL, solve all issues through a proper design. However, I would like to create a simple …

The post How to Use Signals in C# appeared first on {coding}Sight.

]]>
Drilling Down the Visitor Pattern https://codingsight.com/drilling-down-the-visitor-pattern/ Tue, 22 Aug 2017 12:30:04 +0000 http://codingsight.com/?p=2073 Recently, I have often had to use the well-known Visitor pattern. I used to ignore this pattern and thought that it simply complicates the code. In this article, I will share my thoughts about this pattern. We will talk about pros and cons, as well as what tasks it helps to solve and how to …

The post Drilling Down the Visitor Pattern appeared first on {coding}Sight.

]]>
DateTime to DateTimeOffset Transition https://codingsight.com/datetime-to-datetimeoffset-transition/ Tue, 25 Jul 2017 05:48:33 +0000 http://codingsight.com/?p=1892 Imagine that you want to convert your system from one state to another. The initial state is when DateTime is used everywhere, both in C# code and in the database. The final state is when DateTimeOffset is used everywhere. You want to make the transition smooth and make as few changes as possible. This description …

The post DateTime to DateTimeOffset Transition appeared first on {coding}Sight.

]]>
New Features of C# To Be Expected Soon https://codingsight.com/new-features-c-expected-soon/ https://codingsight.com/new-features-c-expected-soon/#comments Thu, 13 Jul 2017 10:40:44 +0000 http://codingsight.com/?p=1804 In April 2003, C# 1.2. was released. Ever since all the versions have had the only major version. Now, if what the official page of roslyn on github  says is true, versions 7.1.and 7.2 are under development. To try version 7.1, it is necessary to install the preview Visual Studio. You can download it from the …

The post New Features of C# To Be Expected Soon appeared first on {coding}Sight.

]]>
https://codingsight.com/new-features-c-expected-soon/feed/ 1