Moving common code to shared lib
This commit is contained in:
@ -1,18 +0,0 @@
|
||||
namespace Model
|
||||
{
|
||||
public class DataModel
|
||||
{
|
||||
public DataModel(string id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public string id { get; set; }
|
||||
|
||||
public string? name { get; set; }
|
||||
|
||||
public string? description { get; set; }
|
||||
|
||||
public string? notes { get; set; }
|
||||
}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
using Confluent.Kafka;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace Serializers
|
||||
{
|
||||
public class JsonSerializer<T> : ISerializer<T>, IDeserializer<T>
|
||||
{
|
||||
public byte[] Serialize(T data, SerializationContext context)
|
||||
{
|
||||
return JsonSerializer.SerializeToUtf8Bytes(data);
|
||||
}
|
||||
|
||||
public T Deserialize(ReadOnlySpan<byte> data, bool isNull, SerializationContext context)
|
||||
{
|
||||
if (!isNull)
|
||||
{
|
||||
return JsonSerializer.Deserialize<T>(data);
|
||||
}
|
||||
throw new Exception ("Data cannot be null");
|
||||
}
|
||||
}
|
||||
}
|
@ -12,4 +12,8 @@
|
||||
<PackageReference Include="MongoDB.Driver" Version="2.26.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\shared\shared.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
Reference in New Issue
Block a user