Files
server/src/Core/Models/EntityFramework/Cipher.cs

43 lines
984 B
C#
Raw Normal View History

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; }
[IgnoreMap]
2020-01-08 21:34:49 -05:00
public JsonDocument DataJson
{
get => _dataJson;
set
{
Data = value.ToString();
_dataJson = value;
}
}
[IgnoreMap]
2020-01-08 21:34:49 -05:00
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
}
}
}