using Orleans; using Pole.Core.Domain; using Pole.Core.EventBus.Event; using System; using System.Collections.Generic; using System.Text; namespace Pole.Core.Grains { public abstract class PoleGrain : Grain, IGrainWithStringKey where TAggregateRoot : Entity, IAggregateRoot, new() { public void Update(TAggregateRoot aggregateRoot) { aggregateRoot.IsPersisted = true; State = aggregateRoot; } public void Add(TAggregateRoot aggregateRoot) { aggregateRoot.IsPersisted = false; State = aggregateRoot; } } }