mirror of
https://github.com/bitwarden/server
synced 2025-12-10 13:23:27 +00:00
43 lines
984 B
C#
43 lines
984 B
C#
using System.Text.Json;
|
|
using AutoMapper;
|
|
|
|
namespace Bit.Core.Models.EntityFramework
|
|
{
|
|
public class Cipher : Table.Cipher
|
|
{
|
|
private JsonDocument _dataJson;
|
|
private JsonDocument _attachmentsJson;
|
|
|
|
public User User { get; set; }
|
|
public Organization Organization { get; set; }
|
|
[IgnoreMap]
|
|
public JsonDocument DataJson
|
|
{
|
|
get => _dataJson;
|
|
set
|
|
{
|
|
Data = value.ToString();
|
|
_dataJson = value;
|
|
}
|
|
}
|
|
[IgnoreMap]
|
|
public JsonDocument AttachmentsJson
|
|
{
|
|
get => _attachmentsJson;
|
|
set
|
|
{
|
|
Attachments = value.ToString();
|
|
_attachmentsJson = value;
|
|
}
|
|
}
|
|
}
|
|
|
|
public class CipherMapperProfile : Profile
|
|
{
|
|
public CipherMapperProfile()
|
|
{
|
|
CreateMap<Table.Cipher, Cipher>().ReverseMap();
|
|
}
|
|
}
|
|
}
|