Category: C Sharp Tricks

Why do Java developers wear glasses?
Because they do not C#.

Competitive Programming – Bus Stops Problem – Video

In competitive programming, following the ICPC rules, one of the best strategies is to scan the problems given to your team and to start with the easiest ones. The easiest ones are not always the first problems and sometimes these

Tagged with: , ,

C# – Learn about advanced scenarios – ASP.NET MVC with EF Core

Exactly 1 month and 5 days after the first video tutorial for the ASP.NET MVC with EF Core series, the last 10th video tutorial, following the Microsoft ones, is published. It is about advanced scenarios, and I have mentioned the

Tagged with: , , , ,

C# – Implementing Inheritance – ASP.NET MVC with EF Core

Slowly, after handling concurrency in the ASP.NET MVC application, we are approaching the end of the video tutorial series. Implementing inheritance is the prelast one and it is actually pretty an important one as well. In the video, the following

Tagged with: , , ,

Book Review – Pro ASP.NET Core MVC 2

Adam Freeman has written the 7th edition of the Pro ASP.NET Core MVC 2 book. And there should really be a reason to issue the book so many times! The book itself gives my favourite way of presenting software –

Tagged with: , ,

C# – Handle concurrency – ASP.NET MVC with EF Core

After updating the related data in the ASP.NET tutorial, it is time for the next step – handling concurrency in the MVC Application. These are the points, followed by the video: Learn about concurrency conflicts Add a tracking property Create

Tagged with: , , , ,

C# – Update related data – ASP.NET MVC with EF Core

After reading complex the data, it is time to be able to update it. This video fills the following points from the ASP.NET MVC tutorial: Customize Courses pages Add Instructors Edit page Add courses to Edit page Update Delete page

Tagged with: , , , ,

C# – Read related data – ASP.NET MVC with EF Core – Video

After creating a complex data model, now it is time to display the data, following the tutorial. The task is actually a challenging one, as far as the data display is in a way partial – in the  “Instructors” view,

Tagged with: , , ,

C# – Create a complex data model – ASP.NET MVC with EF Core – Video

Creating a complex data model with the previous data model in ASP.NET is actually a challenging task. The model in general looks like this: It is not “extremely” complex, but it is something bigger than the previous 3 tables that

Tagged with: , , , ,

C# – Using Migrations – ASP.NET MVC with EF Core – Video

Migrations in C# are quite well facilitated by the EntityFramework. In general, when an application with databse is created, initially the database model is taken from the model classes. When these models classes change, then they get out of sync

Tagged with: , , , , ,

C# – Add sorting, filtering, and paging – ASP.NET MVC – Video

Sorting, filtering, paging and summary of an app are quite important features. In this video, which is a continuation of the Microsoft tutorial, I present step-by-step how to do each one of these. It is quite a large video, but

Tagged with: , , , ,

C# – Implement CRUD Functionality – ASP.NET MVC with EF Core – Video

This is the second video of the Microsoft tutorials, for ASP.NET MVC with Entity Framework Core: Continuing the previous video, in this one the following tasks are carried out: Customize the Details page Update the Create page Update the Edit

Tagged with: , , ,

C# – Get started with EF Core in an ASP.NET MVC Web App – Video

Lately, I have started with creating video tutorials for ASP.NET. Thus, today it is time to deep dive in the ASP.NET once again, following the Microsoft tutorial for ASP.NET MVC Web App from here. In the video below, the following

Tagged with: , , , , , ,

C# – Create a web app with ASP.NET Core MVC – Video

Creating a web application with ASP.NET could look as a hard task. Still, with the pre-built MVC models from Visual Studio, the task is a bit easier. This is how the application looks like, with 2 search buttons and fully

Tagged with: , , , , , ,

C# – Create a web API with ASP.NET Core – Video

Web API with Visual Studio 2019 is quite a bolierplate task – it is doable in less than 45 minutes, following the Microsoft.com tutorial: The video tutorial is here: The TodoController , implementing the CRUD actions looks like this:

The

Tagged with: , , , ,

C# – ASP.NET Core MVC Application with Basic Database Access using Entity Framework – Video

The title somehow looks like random words, picked from a hat at one of those college games we are not supposed to talk about. Anyway, at the second reading it hopefully becomes a bit clearer. And it is simply the

Tagged with: , , , ,

ASP – Data Entry MVC Application with Database – Video

After the first video for MVC here, I have decided to make a next part, in which I save the entries to a database and display them:             Sounds like a tiny update. However, it

Tagged with: , , , , ,

C# – xUnit Test Implementation in Fibonacci Calculation – Video

Good software comes with tests. Fortunately, Visual Studio 2019 provides quite nice ways to test the software you are creating. One of these is xUnit – xunit.net. Thus, I have decided to make a video, showing how to implement xUnit

Tagged with: , , , ,

ASP – Data Entry MVC Application – Video

I have started reading the 2nd edition of the Pro ASP.NET Core MVC book and after reading the first couple of chapters, I have decided to make a video of the application in the second chapter. The code is about

Tagged with: , , , ,

C# – Look at the Variables’ Values, while Debugging in Visual Studio

Debugging is like being the detective in a crime movie where you are also the murderer. In order to debug well, we need to know the value of the current variable. In Visual Studio, this could be acquired through multiple ways.

Tagged with: , , , ,

C# – How to get the last filled cell of a given row in Excel

Getting the last row of a given column in Excel with a formula or with VBA is quite a trivial task. It is explained here quite well 🙂 However, when we come to C#, the only “trick” that is provided

Tagged with: , , , ,

C# – Find the Biggest Square in a Matrix – What can Excel and VBA add to it?

Finding the biggest square of specific units in a given matrix of these units is a standard dynamic programming problem. The examples in Google for it are above 18 million, thus I would simply show how it is done with

Tagged with: , ,

C# – Refactoring a Problem

Some days ago I have decided to take a look at one of the homeworks problem of the OOP course at SoftUni. Then, I have decided to solve it with my VBA OOP knowledge, implementing it in C#. Whether VBA

Tagged with: , ,

C# – Quick Reference for Abstract Classes

Abstract Classes in C# are classes, intended only to be a base class of other classes. Members marked as abstract, or included in an abstract class, must be implemented by classes that derive from the abstract class. Reference With other

Tagged with: , ,

Visual Studio – How to create a custom shortcut

If you want to create a custom shortcut to a command in Visual Studio, these are the steps to be taken: Ribbon>Tools>Options Environment>Keyboard Show commands containing (write the command) Press shortcut keys Assign and OK

Tagged with: , ,

C# – Entity Framework – Using LINQPad for Queries – Just Getting Started

After the previous two articles for C# – Foreign Keys in Entity Framework – Code First – Query with Linq and Entity Framework – Linq vs Extension Methods (Example) it is a good idea to present some actions with LINQPad. LINQPad5 is

Tagged with: , ,

C# – Foreign Keys in Entity Framework – Code First – Query with Linq

In this article, I present an Entity Framework example, building two tables with foreign keys, using code first. The sample I am using is building over the previous article for EF. Pretty much, when you are running your application, if

Tagged with: , , ,

Entity Framework – Linq vs Extension Methods (Example)

This article presents a simple example of querying with Linq and Extension Methods in Entity Framework (EF). To set the EF, create a C# Console application. Then add the Package Manager Console from Tools: Then run Install-Package EntityFramework in the Package

Tagged with: , , ,

C# – Split String in One Line and Get the First SubString

Imagine, that you are given a string in C# with some separator in it, and you need to split it and refer to the first or the second part of the splitted string. E.g., you are having  *AAAaa*SEPARATOR*zzZZZ* and with one line,

Tagged with: ,

C# – Casino Black and Red Simulation – is it Worthy?

Going to a casino is probably quite an easy way to lose money. In the long term. Let’s say that you are following the strategy – always double when you lose and you bet on numbers above 18 on the

Tagged with: , , ,

.Net – Reading Excel file in C# and transferring it to a matrix

There is an ERP joke, claiming that the third most popular button of an ERP system is “Export to Excel” (after OK and Cancel). Thus, working with Excel from .Net is happens often. There are some pitfalls, that you should

Tagged with: , , , ,
Top