start new controllers

This commit is contained in:
2021-11-23 15:43:21 +01:00
parent bffddbe9a8
commit a9bf2d28cb
61 changed files with 578 additions and 891 deletions
+30
View File
@@ -0,0 +1,30 @@
namespace zero.Models;
public class ZeroReference
{
public ZeroReference() { }
public ZeroReference(ZeroEntity entity)
{
Id = entity.Id;
Name = entity.Name;
}
public static ZeroReference From(ZeroEntity entity)
{
return entity == null ? null : new ZeroReference(entity);
}
public static ZeroReference From<T>(T entity, Func<T, string> transform) where T : ZeroEntity
{
return entity == null ? null : new ZeroReference()
{
Id = entity.Id,
Name = transform(entity)
};
}
public string Id { get; set; }
public string Name { get; set; }
}