Posts

Showing posts with the label .netcore

Latest post

Entity Framework Core Custom Pluralizer - .Net Core

This will automatically pluralize EF entities in .Net Core. The following Nuget packages need to be installed in your project. Microsoft.EntityFrameworkCore.Design Microsoft.EntityFrameworkCore.SqlServer Microsoft.EntityFrameworkCore.Tools PluralizeService.Core 1. Create a new folder called "Pluralization" 2. Create the following classes below:

Update audit fields automatically using Entity Framework

I use this snippet to make sure I am always setting the audit fields globally so you can implement in one place and you are done with the auditing part. There's no need to set audit fields in every class. Pre-requisites: The following database table columns must be present in at least 1 database table: CreatedByUserID (int) CreatedDate (datetime) LastUpdatedByUserID (int) LastUpdatedDate (datetime) A DbContext has been generated for your database