mirror of https://github.com/abpframework/abp.git
1 changed files with 16 additions and 0 deletions
@ -0,0 +1,16 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
||||
|
using Newtonsoft.Json; |
||||
|
|
||||
|
namespace Volo.Abp.EntityFrameworkCore.ValueConverters |
||||
|
{ |
||||
|
public class AbpJsonValueConverter<TPropertyType> : ValueConverter<TPropertyType, string> |
||||
|
{ |
||||
|
public AbpJsonValueConverter() |
||||
|
: base( |
||||
|
d => JsonConvert.SerializeObject(d, Formatting.None), |
||||
|
s => JsonConvert.DeserializeObject<TPropertyType>(s)) |
||||
|
{ |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue