public interface IAggregateRoot
{
}
public abstract class AggregateRoot
{
protected abstract bool Validate();
public bool CanBeSaved() => Validate();
}
public class Computer : IEntity, IAggregateRoot
{
public string Name { get; set; }
public Hardware Hardware { get; set; }
public Software Software { get; set; }
}
public class Hardware : IEntity { }
public class Software : IValueObject { }
public interface IRepository<T> where T : IAggregateRoot
{
}