-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document that value-converted types aren't support in raw SQL (#3716)
Also remove the limitation that value converters can't be bulk-configured, that was done in 6.0. Relates to dotnet/efcore#27354
- Loading branch information
Showing
3 changed files
with
39 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
samples/core/Modeling/BulkConfiguration/CurrencyContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Microsoft.EntityFrameworkCore; | ||
|
||
namespace EFModeling.BulkConfiguration | ||
{ | ||
public class CurrencyContext : DbContext | ||
{ | ||
public DbSet<Product> Products { get; set; } | ||
|
||
#region ConfigureConventions | ||
protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder) | ||
{ | ||
configurationBuilder | ||
.Properties<Currency>() | ||
.HaveConversion<CurrencyConverter>(); | ||
} | ||
#endregion | ||
|
||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) | ||
=> optionsBuilder.UseSqlServer( | ||
@"Server=(localdb)\mssqllocaldb;Database=EFModeling.BulkConfiguration.Currency;Trusted_Connection=True") | ||
.LogTo(Console.WriteLine, minimumLevel: Microsoft.Extensions.Logging.LogLevel.Information) | ||
.EnableSensitiveDataLogging(); | ||
} | ||
} |