public void Save(IAggregate aggregate) { var state = aggregate.GetState(); using (var tx = _session.BeginTransaction()) { _session.Save(state); tx.Commit(); } }
/// <summary> /// Persists the state of an aggregate. /// </summary> /// <typeparam name="TState">Type of the state to persist.</typeparam> /// <param name="aggregate">Aggregate containing the state to persist.</param> public void Save <TState>(IAggregate <TState> aggregate) where TState : class { Save(aggregate.GetState()); }