@@ -257,6 +257,29 @@ private static List<JsonPropertyWriter> BuildJsonPropertyWriters(IComplexType co
257257 return writers ;
258258 }
259259
260+ private static void AddJsonOwnedProperty ( List < ColumnInfor > columnInfors , INavigation ownedNavigation )
261+ {
262+ var containerColumnName = ownedNavigation . TargetEntityType . GetContainerColumnName ( ) ;
263+ var containerColumnType = ownedNavigation . TargetEntityType . GetContainerColumnType ( ) ?? "nvarchar(max)" ;
264+
265+ var jsonPropertyWriters = BuildJsonPropertyWriters ( ownedNavigation . TargetEntityType ) ;
266+
267+ columnInfors . Add ( new ColumnInfor
268+ {
269+ PropertyName = ownedNavigation . Name ,
270+ PropertyType = ownedNavigation . TargetEntityType . ClrType ,
271+ ColumnName = containerColumnName ,
272+ ColumnType = containerColumnType ,
273+ ValueGenerated = ValueGenerated . Never ,
274+ DefaultValueSql = null ,
275+ IsPrimaryKey = false ,
276+ IsRowVersion = false ,
277+ ValueConverter = null ,
278+ IsJson = true ,
279+ JsonPropertyWriters = jsonPropertyWriters
280+ } ) ;
281+ }
282+
260283 private static List < JsonPropertyWriter > BuildJsonPropertyWriters ( IEntityType entityType , string clrPrefix = "" , string jsonPrefix = "" )
261284 {
262285 var writers = new List < JsonPropertyWriter > ( ) ;
@@ -306,29 +329,6 @@ private static List<JsonPropertyWriter> BuildJsonPropertyWriters(IEntityType ent
306329 return writers ;
307330 }
308331
309- private static void AddJsonOwnedProperty ( List < ColumnInfor > columnInfors , INavigation ownedNavigation )
310- {
311- var containerColumnName = ownedNavigation . TargetEntityType . GetContainerColumnName ( ) ;
312- var containerColumnType = ownedNavigation . TargetEntityType . GetContainerColumnType ( ) ?? "nvarchar(max)" ;
313-
314- var jsonPropertyWriters = BuildJsonPropertyWriters ( ownedNavigation . TargetEntityType ) ;
315-
316- columnInfors . Add ( new ColumnInfor
317- {
318- PropertyName = ownedNavigation . Name ,
319- PropertyType = ownedNavigation . TargetEntityType . ClrType ,
320- ColumnName = containerColumnName ,
321- ColumnType = containerColumnType ,
322- ValueGenerated = ValueGenerated . Never ,
323- DefaultValueSql = null ,
324- IsPrimaryKey = false ,
325- IsRowVersion = false ,
326- ValueConverter = null ,
327- IsJson = true ,
328- JsonPropertyWriters = jsonPropertyWriters
329- } ) ;
330- }
331-
332332 private static void AddComplexProperty ( List < ColumnInfor > columnInfors , IComplexProperty complexProperty , StoreObjectIdentifier storeObjectIdentifier , string prefix = "" )
333333 {
334334 var entityProperties = complexProperty . ComplexType . GetProperties ( ) ;
0 commit comments