split Idenfitier Converter out into its own file
This commit is contained in:
parent
43353da2f4
commit
880ba8e16f
@ -0,0 +1,29 @@
|
||||
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
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -29,29 +29,4 @@ 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
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -78,6 +78,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="CardUniqueId.cs" />
|
||||
<Compile Include="Converters\IdentifierConverter.cs" />
|
||||
<Compile Include="Converters\LogDirectionConverter.cs" />
|
||||
<Compile Include="Converters\LogSourceConverter.cs" />
|
||||
<Compile Include="Converters\PolicyConverter.cs" />
|
||||
|
||||
Loading…
Reference in New Issue
Block a user