1
0
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:
Kyle Spearrin
2020-01-10 18:54:44 -05:00
parent d653629e79
commit 5bb440563f
4 changed files with 30 additions and 4 deletions

View File

@ -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

View File

@ -16,7 +16,7 @@ namespace Bit.Core.Models.EntityFramework
get => _twoFactorProvidersJson;
set
{
TwoFactorProviders = value.ToString();
TwoFactorProviders = value?.ToString();
_twoFactorProvidersJson = value;
}
}

View File

@ -16,7 +16,7 @@ namespace Bit.Core.Models.EntityFramework
get => _twoFactorProvidersJson;
set
{
TwoFactorProviders = value.ToString();
TwoFactorProviders = value?.ToString();
_twoFactorProvidersJson = value;
}
}