mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 08:02:49 -05:00
just type mapping for json docs
This commit is contained in:
@ -7,6 +7,8 @@ namespace Bit.Core.Models.EntityFramework
|
||||
{
|
||||
private JsonDocument _dataJson;
|
||||
private JsonDocument _attachmentsJson;
|
||||
private JsonDocument _favoritesJson;
|
||||
private JsonDocument _foldersJson;
|
||||
|
||||
public User User { get; set; }
|
||||
public Organization Organization { get; set; }
|
||||
@ -16,7 +18,7 @@ namespace Bit.Core.Models.EntityFramework
|
||||
get => _dataJson;
|
||||
set
|
||||
{
|
||||
Data = value.ToString();
|
||||
Data = value?.ToString();
|
||||
_dataJson = value;
|
||||
}
|
||||
}
|
||||
@ -26,10 +28,30 @@ namespace Bit.Core.Models.EntityFramework
|
||||
get => _attachmentsJson;
|
||||
set
|
||||
{
|
||||
Attachments = value.ToString();
|
||||
Attachments = value?.ToString();
|
||||
_attachmentsJson = value;
|
||||
}
|
||||
}
|
||||
[IgnoreMap]
|
||||
public JsonDocument FavoritesJson
|
||||
{
|
||||
get => _favoritesJson;
|
||||
set
|
||||
{
|
||||
Favorites = value?.ToString();
|
||||
_favoritesJson = value;
|
||||
}
|
||||
}
|
||||
[IgnoreMap]
|
||||
public JsonDocument FoldersJson
|
||||
{
|
||||
get => _foldersJson;
|
||||
set
|
||||
{
|
||||
Folders = value?.ToString();
|
||||
_foldersJson = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class CipherMapperProfile : Profile
|
||||
|
@ -16,7 +16,7 @@ namespace Bit.Core.Models.EntityFramework
|
||||
get => _twoFactorProvidersJson;
|
||||
set
|
||||
{
|
||||
TwoFactorProviders = value.ToString();
|
||||
TwoFactorProviders = value?.ToString();
|
||||
_twoFactorProvidersJson = value;
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ namespace Bit.Core.Models.EntityFramework
|
||||
get => _twoFactorProvidersJson;
|
||||
set
|
||||
{
|
||||
TwoFactorProviders = value.ToString();
|
||||
TwoFactorProviders = value?.ToString();
|
||||
_twoFactorProvidersJson = value;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user