添加聚合根
This commit is contained in:
@@ -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>
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using NET.AutoWebApi.Helper;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Security.Principal;
|
using System.Security.Principal;
|
||||||
@@ -21,6 +22,12 @@ namespace Yi.Framework.Ddd.Entities
|
|||||||
|
|
||||||
public abstract object[] GetKeys();
|
public abstract object[] GetKeys();
|
||||||
|
|
||||||
|
//实体比较简化
|
||||||
|
//public bool EntityEquals(IEntity other)
|
||||||
|
//{
|
||||||
|
// return this.GetKeys().Equals(other.GetKeys());
|
||||||
|
//}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
@@ -46,5 +53,7 @@ namespace Yi.Framework.Ddd.Entities
|
|||||||
{
|
{
|
||||||
return $"[ENTITY: {GetType().Name}] Id = {Id}";
|
return $"[ENTITY: {GetType().Name}] Id = {Id}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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>
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user