public virtual IEvent GetEvent(IEventStoreAggregateId eventStoreAggregateId, long version) { object idObj = ((EventStoreAggregateId)eventStoreAggregateId).Id; AttributeSetInstanceState state = CurrentSession.Get <AttributeSetInstanceState>(idObj); return(new AttributeSetInstanceStateCreated(state)); }
public IAttributeSetInstanceState Get(string id) { IAttributeSetInstanceState state = CurrentSession.Get <AttributeSetInstanceState> (id); if (state == null) { state = new AttributeSetInstanceState(); (state as AttributeSetInstanceState).AttributeSetInstanceId = id; } return(state); }
public static IEnumerable <IAttributeSetInstanceState> ToAttributeSetInstanceStateCollection(IEnumerable <string> ids) { var states = new List <AttributeSetInstanceState>(); foreach (var id in ids) { var s = new AttributeSetInstanceState(); s.AttributeSetInstanceId = id; states.Add(s); } return(states); }
public IAttributeSetInstanceState Get(string id, bool nullAllowed) { IAttributeSetInstanceState state = CurrentSession.Get <AttributeSetInstanceState> (id); if (!nullAllowed && state == null) { state = new AttributeSetInstanceState(); (state as AttributeSetInstanceState).AttributeSetInstanceId = id; } if (ReadOnlyProxyGenerator != null && state != null) { return(ReadOnlyProxyGenerator.CreateProxy <IAttributeSetInstanceState>(state, new Type[] { }, _readOnlyPropertyNames)); } return(state); }
public void AppendEvents(IEventStoreAggregateId eventStoreAggregateId, long version, ICollection <IEvent> events, Action afterEventsAppended) { foreach (IEvent e in events) { if (e is AttributeSetInstanceStateCreated) { AttributeSetInstanceState s = ((AttributeSetInstanceStateCreated)e).AttributeSetInstanceState; CurrentSession.Save(s); } else { CurrentSession.Save(e); } var saveable = e as ISaveable; if (saveable != null) { saveable.Save(); } } //Console.WriteLine("####################################################"); afterEventsAppended(); //Console.WriteLine("####################################################"); }
public static CreateAttributeSetInstance ToCreateAttributeSetInstance(this AttributeSetInstanceState state) { return(state.ToCreateAttributeSetInstance <CreateAttributeSetInstance>()); }
public static MergePatchAttributeSetInstance ToMergePatchAttributeSetInstance(this AttributeSetInstanceState state) { return(state.ToMergePatchAttributeSetInstance <MergePatchAttributeSetInstance>()); }
public static DeleteAttributeSetInstance ToDeleteAttributeSetInstance(this AttributeSetInstanceState state) { return(state.ToDeleteAttributeSetInstance <DeleteAttributeSetInstance>()); }
public static IAttributeSetInstanceCommand ToCreateOrMergePatchAttributeSetInstance(this AttributeSetInstanceState state) { return(state.ToCreateOrMergePatchAttributeSetInstance <CreateAttributeSetInstance, MergePatchAttributeSetInstance>()); }