func (r *GetEventStoreCommonDomainRepo) SetEventFactory(factory EventFactory) {
	r.eventFactory = factory
}
SetEventFactory sets the event factory that should be used to instantiate event
instances.

Only one event factory can be set at a time. Any subsequent registration will
overwrite the previous factory.
package ycq
import (
	"fmt"
	"net/url"
	"github.com/jetbasrawi/go.geteventstore"
)
type DomainRepository interface {
	Load(aggregateTypeName string, aggregateID string) (AggregateRoot, error)
	Save(aggregate AggregateRoot, expectedVersion *int) error
}
type GetEventStoreCommonDomainRepo struct {
	eventStore         *goes.Client
	eventBus           EventBus
	streamNameDelegate StreamNamer
	aggregateFactory   AggregateFactory
	eventFactory       EventFactory
}
func NewCommonDomainRepository(eventStore *goes.Client, eventBus EventBus) (*GetEventStoreCommonDomainRepo, error) {
	if eventStore == nil {
		return nil, fmt.Errorf("Nil Eventstore injected into repository.")
	}
	if eventBus == nil {
		return nil, fmt.Errorf("Nil EventBus injected into repository.")
	}
	d := &GetEventStoreCommonDomainRepo{
		eventStore: eventStore,
		eventBus:   eventBus,
	}
	return d, nil
}
func (r *GetEventStoreCommonDomainRepo) SetAggregateFactory(factory AggregateFactory) {
	r.aggregateFactory = factory
}