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

33 lines
739 B
C#
Raw Normal View History

2020-01-08 20:28:16 -05:00
using System.Collections.Generic;
2020-01-08 21:38:32 -05:00
using System.Text.Json;
2020-01-08 20:28:16 -05:00
using AutoMapper;
namespace Bit.Core.Models.EntityFramework
{
public class User : Table.User
{
2020-01-08 21:38:32 -05:00
private JsonDocument _twoFactorProvidersJson;
2020-01-08 20:28:16 -05:00
public ICollection<Cipher> Ciphers { get; set; }
2020-01-08 21:38:32 -05:00
[IgnoreMap]
2020-01-08 21:38:32 -05:00
public JsonDocument TwoFactorProvidersJson
{
get => _twoFactorProvidersJson;
set
{
2020-01-10 18:54:44 -05:00
TwoFactorProviders = value?.ToString();
2020-01-08 21:38:32 -05:00
_twoFactorProvidersJson = value;
}
}
2020-01-08 20:28:16 -05:00
}
public class UserMapperProfile : Profile
{
public UserMapperProfile()
{
2020-01-08 21:34:49 -05:00
CreateMap<Table.User, User>().ReverseMap();
2020-01-08 20:28:16 -05:00
}
}
}