csharp

Default interface methods no C#

Default interface methods no C#

Interfaces com métodos padrões se trata da capacidade de adicionar assinaturas de métodos em uma interface com um corpo definido (com um comportamento padrão ou mesmo um corpo vazio) fazendo com que as classes que implementam essa interface não tenham a obrigatoriedade de implementar esse novo método adicionado na interface. Imagine o seguinte cenário genérico: Temos uma interface IAnimal que contém métodos comuns que simulam comportamentos comuns de todos os animais. public interface IAnimal { void MakeSound(); void Eat(); void Sleep(); } Enter fullscreen mode Exit fullscreen mode Temos 3 classes que representam animais terrestres e que implementam a interface…
Read More
Implementing the Cached Repository Pattern in C#

Implementing the Cached Repository Pattern in C#

Cached Repository in C#: An Introductory Article Using the Decorator Pattern and Entity Framework Core Introduction to the Concept of a Cached Repository A cached repository is a design pattern aimed at enhancing application performance by storing data in a fast-access memory area known as a cache. This reduces the number of database accesses, thereby improving response times and the application's scalability. A repository abstracts data access and provides uniform interfaces for CRUD operations (Create, Read, Update, Delete). Combining these concepts offers a powerful method for optimizing data access patterns in modern applications. Importance and Benefits of Using Cached Repositories…
Read More
The Open/Closed Principle in C# with Filters and Specifications

The Open/Closed Principle in C# with Filters and Specifications

Software design principles are fundamental in ensuring our code remains maintainable, scalable, and robust. One of the key principles in the SOLID design principles is the Open/Closed Principle (OCP). This principle states that software entities should be open for extension but closed for modification. Let’s explore how we can adhere to this principle through a practical example involving product filtering. Initial Implementation: The Problem Imagine we have a simple product catalog where each product has a name, color, and size. We need a way to filter these products based on various criteria. A straightforward implementation might look like this: public…
Read More
Differences between Asp.net and Asp.net Core

Differences between Asp.net and Asp.net Core

ASP.NET and ASP.NET Core are both frameworks for building web applications and services, but they have several key differences. Here are the main distinctions between the two: 1. Cross-Platform Support ASP.NET: Primarily designed to run on Windows. It can run on Windows Server and Internet Information Services (IIS). ASP.NET Core: Cross-platform, running on Windows, macOS, and Linux. It supports different web servers like Kestrel and IIS and can run in containers and cloud environments. 2. Performance ASP.NET: Performance is good but not as optimized as ASP.NET Core. ASP.NET Core: Highly optimized for performance. It is known for its high throughput…
Read More
Elanat CMS 2.2 Released – Under .NET Core

Elanat CMS 2.2 Released – Under .NET Core

Elanat CMS is one of the best systems on the web. There is also a built-in CMS in Elanat core. Elanat uses an CodeBehind infrastructure MVC architecture that is not related to Microsoft ASP.NET Core. This system is very powerful and very large and it benefits from a very modern structure that allows you to create several new add-ons for Elanat CMS every day. The wonderful structure of Elanat is in a way that it interacts with 8 types of add-ons, all of which are components, and the component itself is also a component. In the admin section, all component…
Read More
Velvetauth new authentication

Velvetauth new authentication

Simplify and Secure Your Application Authentication with VelvetAuth As a C# developer, you know the importance of implementing robust authentication mechanisms to protect your applications and ensure that only authorized users gain access. However, creating a secure and user-friendly authentication system from scratch can be a daunting task. This is where VelvetAuth comes in. What is VelvetAuth? VelvetAuth is a comprehensive software authentication solution designed to simplify and secure user authentication for your applications. It uses both token-based systems and general registration options to provide a range of features ensuring your applications are secure and easy to manage. Key Features…
Read More
EF Core 8 Update Entity

EF Core 8 Update Entity

When entities are being tracked (this is the default, to track changes) EF Core is efficient with updates in that if there are several properties for a model and only one or two properties changed the update statement only updates those columns/properties which changed rather than every column/property. Model public partial class Person { public int Id { get; set; } public string Title { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public DateOnly BirthDate { get; set; } } Enter fullscreen mode Exit fullscreen mode Example 1 Read data.…
Read More
Desvendando o Futuro do Desenvolvimento de Aplicativos com .NET MAUI

Desvendando o Futuro do Desenvolvimento de Aplicativos com .NET MAUI

No mundo dinâmico e em constante evolução do desenvolvimento de software, a busca por frameworks eficientes e versáteis é incessante. É nesse contexto que o .NET MAUI (Multi-platform App UI) surge como uma verdadeira revolução, proporcionando uma plataforma unificada para a criação de aplicativos nativos que funcionam em diversas plataformas. Neste artigo, vamos explorar as vantagens e inovações que o .NET MAUI traz para os desenvolvedores e como ele pode transformar sua abordagem ao desenvolvimento de aplicativos. O que é o .NET MAUI? .NET MAUI é a evolução do Xamarin.Forms, projetado para simplificar o desenvolvimento de aplicativos que podem ser…
Read More
No widgets found. Go to Widget page and add the widget in Offcanvas Sidebar Widget Area.