mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 08:02:49 -05:00
org repo
This commit is contained in:
@ -1,17 +1,40 @@
|
||||
using AutoMapper;
|
||||
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; }
|
||||
public JsonDocument DataJson
|
||||
{
|
||||
get => _dataJson;
|
||||
set
|
||||
{
|
||||
Data = value.ToString();
|
||||
_dataJson = value;
|
||||
}
|
||||
}
|
||||
public JsonDocument AttachmentsJson
|
||||
{
|
||||
get => _attachmentsJson;
|
||||
set
|
||||
{
|
||||
Attachments = value.ToString();
|
||||
_attachmentsJson = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class CipherMapperProfile : Profile
|
||||
{
|
||||
public CipherMapperProfile()
|
||||
{
|
||||
CreateMap<Table.Cipher, Cipher>();
|
||||
CreateMap<Table.Cipher, Cipher>().ReverseMap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
18
src/Core/Models/EntityFramework/Organization.cs
Normal file
18
src/Core/Models/EntityFramework/Organization.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System.Collections.Generic;
|
||||
using AutoMapper;
|
||||
|
||||
namespace Bit.Core.Models.EntityFramework
|
||||
{
|
||||
public class Organization : Table.Organization
|
||||
{
|
||||
public ICollection<Cipher> Ciphers { get; set; }
|
||||
}
|
||||
|
||||
public class OrganizationMapperProfile : Profile
|
||||
{
|
||||
public OrganizationMapperProfile()
|
||||
{
|
||||
CreateMap<Table.Organization, Organization>().ReverseMap();
|
||||
}
|
||||
}
|
||||
}
|
@ -12,7 +12,7 @@ namespace Bit.Core.Models.EntityFramework
|
||||
{
|
||||
public UserMapperProfile()
|
||||
{
|
||||
CreateMap<Table.User, User>();
|
||||
CreateMap<Table.User, User>().ReverseMap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user