api: implement entity converters
This commit is contained in:
18
Pilz.Net/Api/Entities/IEntityConverterProvider.cs
Normal file
18
Pilz.Net/Api/Entities/IEntityConverterProvider.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Pilz.Data;
|
||||
|
||||
namespace Pilz.Net.Api.Entities;
|
||||
|
||||
public interface IEntityConverterProvider<TEntity, TUpdateMsg>
|
||||
where TEntity : class, IDataObject
|
||||
where TUpdateMsg : ApiMessage
|
||||
{
|
||||
IEntityConverter<TEntity, TUpdateMsg>? GetEntityConverter() => this as IEntityConverter<TEntity, TUpdateMsg>;
|
||||
}
|
||||
|
||||
public interface IEntityConverterProvider<TEntity, TParent, TUpdateMsg>
|
||||
where TEntity : class, IDataObject
|
||||
where TParent : class, IDataObject
|
||||
where TUpdateMsg : ApiMessage
|
||||
{
|
||||
IEntityConverter<TEntity, TParent, TUpdateMsg>? GetEntityConverter() => this as IEntityConverter<TEntity, TParent, TUpdateMsg>;
|
||||
}
|
||||
Reference in New Issue
Block a user