2020-01-08 21:34:49 -05:00
|
|
|
|
using System.Text.Json;
|
|
|
|
|
|
using AutoMapper;
|
2020-01-08 20:28:16 -05:00
|
|
|
|
|
|
|
|
|
|
namespace Bit.Core.Models.EntityFramework
|
|
|
|
|
|
{
|
|
|
|
|
|
public class Cipher : Table.Cipher
|
|
|
|
|
|
{
|
2020-01-08 21:34:49 -05:00
|
|
|
|
private JsonDocument _dataJson;
|
|
|
|
|
|
private JsonDocument _attachmentsJson;
|
|
|
|
|
|
|
2020-01-08 20:28:16 -05:00
|
|
|
|
public User User { get; set; }
|
2020-01-08 21:34:49 -05:00
|
|
|
|
public Organization Organization { get; set; }
|
|
|
|
|
|
public JsonDocument DataJson
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _dataJson;
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
Data = value.ToString();
|
|
|
|
|
|
_dataJson = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
public JsonDocument AttachmentsJson
|
|
|
|
|
|
{
|
|
|
|
|
|
get => _attachmentsJson;
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
Attachments = value.ToString();
|
|
|
|
|
|
_attachmentsJson = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-01-08 20:28:16 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class CipherMapperProfile : Profile
|
|
|
|
|
|
{
|
|
|
|
|
|
public CipherMapperProfile()
|
|
|
|
|
|
{
|
2020-01-08 21:34:49 -05:00
|
|
|
|
CreateMap<Table.Cipher, Cipher>().ReverseMap();
|
2020-01-08 20:28:16 -05:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|