actually use the jsonconversion
This commit is contained in:
parent
be9b0c3d9d
commit
88026c07f8
1 changed files with 2 additions and 13 deletions
|
@ -17,19 +17,8 @@ namespace Snootalogue.Data {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnModelCreating(ModelBuilder modelBuilder) {
|
protected override void OnModelCreating(ModelBuilder modelBuilder) {
|
||||||
modelBuilder.Entity<Document>()
|
modelBuilder.Entity<Document>().Property(item => item.Authors).HasJsonConversion<List<string>>();
|
||||||
.Property(item => item.Authors)
|
modelBuilder.Entity<Document>().Property(item => item.Tags).HasJsonConversion<List<string>>();
|
||||||
.HasConversion(
|
|
||||||
value => JsonSerializer.Serialize(value, null),
|
|
||||||
value => JsonSerializer.Deserialize<List<string>>(value, null)
|
|
||||||
);
|
|
||||||
|
|
||||||
modelBuilder.Entity<Document>()
|
|
||||||
.Property(item => item.Tags)
|
|
||||||
.HasConversion(
|
|
||||||
value => JsonSerializer.Serialize(value, null),
|
|
||||||
value => JsonSerializer.Deserialize<List<string>>(value, null)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue