添加聚合根

This commit is contained in:
橙子
2023-01-26 22:38:37 +08:00
parent dfefd0452d
commit c7e74774de
3 changed files with 41 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Framework.Ddd.Entities
{
public class AggregateRoot : IEntity, IAggregateRoot
{
}
public class AggregateRoot<TKey> : Entity<TKey> ,IEntity<TKey>
{
}
}

View File

@@ -1,4 +1,5 @@
using System;
using NET.AutoWebApi.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
@@ -21,6 +22,12 @@ namespace Yi.Framework.Ddd.Entities
public abstract object[] GetKeys();
//实体比较简化
//public bool EntityEquals(IEntity other)
//{
// return this.GetKeys().Equals(other.GetKeys());
//}
}
[Serializable]
@@ -46,5 +53,7 @@ namespace Yi.Framework.Ddd.Entities
{
return $"[ENTITY: {GetType().Name}] Id = {Id}";
}
}
}

View File

@@ -0,0 +1,16 @@
using Microsoft.AspNetCore.DataProtection.KeyManagement;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Yi.Framework.Ddd.Entities
{
public interface IAggregateRoot: IEntity
{
}
public interface IAggregateRoot<TKey> : IEntity<TKey>
{
}
}