Category SQL

Using Entity Framework Core to process Azure Service Messages in ASP.NET Core

This article shows how to use Entity Framework Core together with an Azure Service Bus receiver in ASP.NET Core. This message handler is a singleton and so requires that an Entity Framework Core context inside this singleton is not registered as a scoped service but created and disposed for each message event. Code: https://github.com/damienbod/AspNetCoreServiceBus Posts […]

Using EF Core and SQLite to persist SignalR Group messages in ASP.NET Core

The article shows how SignalR messages can be saved to a database using EF Core and SQLite. The post uses the SignalR Hub created in this blog; SignalR Group messages with ngrx and Angular, and extends it so that users can only join an existing SignalR group. The group history is then sent to the […]

.NET Core, ASP.NET Core logging with NLog and PostgreSQL

This article shows how .NET Core or ASP.NET Core applications can log to a PostgreSQL database using NLog. Code: https://github.com/damienbod/AspNetCoreNlog 2020-01-12 Updated to .NET Core 3.1, NLog.Web.AspNetCore 4.9.0 2018-04-04 Updated to NLog.Web.AspNetCore 4.5.1, ASP.NET Core 2.0 Other posts in this series: ASP.NET Core logging with NLog and Microsoft SQL Server ASP.NET Core logging with NLog […]

ASP.NET Core with MySQL and Entity Framework Core

This article shows how to use MySQL with ASP.NET Core 3.1 using Entity Framework Core. Code: https://github.com/damienbod/AspNetCoreMultipleProject Posts in this series: Experiments with Entity Framework Core and ASP.NET Core MVC ASP.NET Core with PostgreSQL and Entity Framework Core ASP.NET Core with MySQL and Entity Framework Core 2020-01-10: Updated to ASP.NET Core 3.1 2018-12-05: Updated to […]

Creating and requesting SQL localized data in ASP.NET Core

This article shows how localized data can be created and used in a running ASP.NET Core application without restarting. The Localization.SqlLocalizer package is used to to get and localize the data, and also to save the resources to a database. Any database which is supported by Entity Framework Core can be used. Code: https://github.com/damienbod/AngularLocalizationAspNetCore 2018-08-01: […]

ASP.NET Core using SQL Localization

This article shows how to use SQL localization in ASP.NET Core using an SQL database. The SQL localization in the demo uses Entity Framework Core to access a SQLite database. This can be configured to use any EF core provider. Code: https://github.com/damienbod/AspNetCoreLocalization Library: https://github.com/damienbod/AspNetCoreLocalization/tree/master/src/Localization.SqlLocalizer NuGet package: https://www.nuget.org/packages/Localization.SqlLocalizer/ Documentation: http://localizationsqllocalizer.readthedocs.io/en/latest/ Posts in this series ASP.NET Core […]

Experiments with Entity Framework Core and an ASP.NET Core API

The article shows some of the ways in which Entity Framework Core can be used together with ASP.NET Core. Both packages run on dotnet which makes it possible to run on Linux, Mac or Windows operating systems. The Entity Framework providers are implemented in separate data access projects using onion architecture. Code: https://github.com/damienbod/AspNetCoreMultipleProject Posts in […]

ASP.NET Core 3.1 MVC File Upload with MS SQL SERVER FileTable

This article shows how to upload and download files in ASP.NET Core 3.0 MVC and save the files to a MS SQL Server using FileTable. The data access for the application is implemented in a separate project and EF Core migrations is used to setup the select logic for the database. Code: https://github.com/damienbod/AspNetCoreFileUploadFileTable 2019-12-21: Updated […]

MVC CRUD with Elasticsearch child, parent documents

This article demonstrates how to search for data in Elasticsearch using parent and child documents. The documents are all saved inside the same index and the child documents are saved on the same shard using the parent id as the routing. As in the previous ElasticsearchCRUD tutorials, an autocomplete in used to search for the […]

Transferring data to Elasticsearch from MS SQL Server using ElasticsearchCRUD and Entity Framework

This article shows how to transfer data from a MS SQL Server 2014 to Elasticsearch. The MS SQL Server is accessed using Entity Framework (Code first from a database). Elasticsearch documents are created using ElasticsearchCRUD and inserted in bulk requests. The Entity Framework entities can be used directly in ElasticsearchCRUD. Either the whole entity including […]