Gestite immagini allegate
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Text.Json;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using SteUp.Shared.Core.Entities;
|
||||
|
||||
namespace SteUp.Data.LocalDb;
|
||||
@@ -23,5 +24,12 @@ public class AppDbContext(DbContextOptions<AppDbContext> options) : DbContext(op
|
||||
|
||||
modelBuilder.Entity<Scheda>()
|
||||
.HasIndex(x => new { x.CodMdep, x.Data, x.Rilevatore });
|
||||
|
||||
modelBuilder.Entity<Scheda>()
|
||||
.Property(x => x.ImageNames)
|
||||
.HasConversion(
|
||||
v => JsonSerializer.Serialize(v, (JsonSerializerOptions?)null),
|
||||
v => JsonSerializer.Deserialize<List<string>>(v, (JsonSerializerOptions?)null) ?? new List<string>()
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user