29 lines
841 B
C#
29 lines
841 B
C#
using Interfaces;
|
|
|
|
namespace SQLiteRepository.Converters
|
|
{
|
|
static class IdentifierConverter
|
|
{
|
|
public static Identifier ConvertToIdentifierDto(CardUniqueId ident)
|
|
{
|
|
return new Identifier
|
|
{
|
|
Id = ident.Id,
|
|
UniqueId = ident.CardUId,
|
|
IsAssociatedToUser = ident.UserId_FK != Constants.UNASSIGNED_CARD_USER_ID,
|
|
LastUsed = ident.LastUsed.DateTime
|
|
};
|
|
}
|
|
|
|
public static CardUniqueId ConvertFromIdentifierDto(Identifier ident, int userId)
|
|
{
|
|
return new CardUniqueId
|
|
{
|
|
CardUId = ident.UniqueId,
|
|
Id = ident.Id,
|
|
UserId_FK = userId,
|
|
LastUsed = ident.LastUsed
|
|
};
|
|
}
|
|
}
|
|
} |