init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
|
@ -0,0 +1,25 @@
|
|||
using System;
|
||||
using Kreta.Core.Exceptions;
|
||||
using Kreta.Ellenorzo.Domain.VN.Interfaces;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.Ellenorzo.Dto.VN.Converter
|
||||
{
|
||||
/// <summary>
|
||||
/// Author: Kovács Kornél (DevKornél) Created On: 2019.10.
|
||||
/// This converts the Uid dto model prop to a string value.
|
||||
/// </summary>
|
||||
public class UidConverter<T> : JsonConverter where T : IReadonlyUidRaw
|
||||
{
|
||||
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
|
||||
{
|
||||
writer.WriteValue(value is IReadonlyUidRaw propertyValue ? propertyValue.UidRaw : throw new BlException(Core.Enum.BlExceptionType.ElvartErtekNemTalalhato));
|
||||
}
|
||||
|
||||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) => throw new NotImplementedException();
|
||||
|
||||
public override bool CanRead => false;
|
||||
|
||||
public override bool CanConvert(Type objectType) => objectType == typeof(string);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue