Add JSON function to models
This commit is contained in:
14
DataAccess/EF_Demo/Data/MSSQL/EventsContext.Custom.cs
Normal file
14
DataAccess/EF_Demo/Data/MSSQL/EventsContext.Custom.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace EF_Demo.Data.MSSQL;
|
||||
|
||||
public partial class EventsContext
|
||||
{
|
||||
partial void OnModelCreatingPartial(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder
|
||||
.HasDbFunction(typeof(DbJson).GetMethod(nameof(DbJson.JsonValue))!)
|
||||
.HasName("JSON_VALUE")
|
||||
.IsBuiltIn();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user