public IDamageHandlingMethodState Get(string id, bool nullAllowed) { IDamageHandlingMethodState state = CurrentSession.Get <DamageHandlingMethodState> (id); if (!nullAllowed && state == null) { state = new DamageHandlingMethodState(); (state as DamageHandlingMethodState).DamageHandlingMethodId = id; } return(state); }
public void Save(IDamageHandlingMethodState state) { IDamageHandlingMethodState s = state; CurrentSession.SaveOrUpdate(s); var saveable = s as ISaveable; if (saveable != null) { saveable.Save(); } CurrentSession.Flush(); }
public async Task <IDamageHandlingMethodState> GetAsync(string damageHandlingMethodId) { IDamageHandlingMethodState state = null; var idObj = damageHandlingMethodId; var uriParameters = new DamageHandlingMethodUriParameters(); uriParameters.Id = idObj; var req = new DamageHandlingMethodGetRequest(uriParameters); var resp = await _ramlClient.DamageHandlingMethod.Get(req); DamageHandlingMethodProxyUtils.ThrowOnHttpResponseError(resp); state = (resp.Content == null) ? null : resp.Content.ToDamageHandlingMethodState(); return(state); }
protected bool IsRepeatedCommand(IDamageHandlingMethodCommand command, IEventStoreAggregateId eventStoreAggregateId, IDamageHandlingMethodState state) { bool repeated = false; if (((IDamageHandlingMethodStateProperties)state).Version == command.AggregateVersion + 1) { if (state.CommandId == command.CommandId) { repeated = true; } } return(repeated); }
private void Persist(IEventStoreAggregateId eventStoreAggregateId, IDamageHandlingMethodAggregate aggregate, IDamageHandlingMethodState state) { StateRepository.Save(state); if (AggregateEventListener != null) { AggregateEventListener.EventAppended(new AggregateEvent <IDamageHandlingMethodAggregate, IDamageHandlingMethodState>(aggregate, state, aggregate.Changes)); } }
public abstract IDamageHandlingMethodAggregate GetDamageHandlingMethodAggregate(IDamageHandlingMethodState state);
public static TCreateDamageHandlingMethod ToCreateDamageHandlingMethod <TCreateDamageHandlingMethod>(this IDamageHandlingMethodState state) where TCreateDamageHandlingMethod : ICreateDamageHandlingMethod, new() { var cmd = new TCreateDamageHandlingMethod(); cmd.Version = ((IDamageHandlingMethodStateProperties)state).Version; cmd.DamageHandlingMethodId = state.DamageHandlingMethodId; cmd.Description = state.Description; cmd.SequenceId = state.SequenceId; cmd.Active = ((IDamageHandlingMethodStateProperties)state).Active; return(cmd); }
public override IDamageHandlingMethodAggregate GetDamageHandlingMethodAggregate(IDamageHandlingMethodState state) { return(new DamageHandlingMethodAggregate(state)); }
public static TDeleteDamageHandlingMethod ToDeleteDamageHandlingMethod <TDeleteDamageHandlingMethod>(this IDamageHandlingMethodState state) where TDeleteDamageHandlingMethod : IDeleteDamageHandlingMethod, new() { var cmd = new TDeleteDamageHandlingMethod(); cmd.DamageHandlingMethodId = state.DamageHandlingMethodId; cmd.Version = ((IDamageHandlingMethodStateProperties)state).Version; return(cmd); }
public static TMergePatchDamageHandlingMethod ToMergePatchDamageHandlingMethod <TMergePatchDamageHandlingMethod>(this IDamageHandlingMethodState state) where TMergePatchDamageHandlingMethod : IMergePatchDamageHandlingMethod, new() { var cmd = new TMergePatchDamageHandlingMethod(); cmd.Version = ((IDamageHandlingMethodStateProperties)state).Version; cmd.DamageHandlingMethodId = state.DamageHandlingMethodId; cmd.Description = state.Description; cmd.SequenceId = state.SequenceId; cmd.Active = ((IDamageHandlingMethodStateProperties)state).Active; if (state.Description == null) { cmd.IsPropertyDescriptionRemoved = true; } if (state.SequenceId == null) { cmd.IsPropertySequenceIdRemoved = true; } return(cmd); }
public static IDamageHandlingMethodCommand ToCreateOrMergePatchDamageHandlingMethod <TCreateDamageHandlingMethod, TMergePatchDamageHandlingMethod>(this IDamageHandlingMethodState state) where TCreateDamageHandlingMethod : ICreateDamageHandlingMethod, new() where TMergePatchDamageHandlingMethod : IMergePatchDamageHandlingMethod, new() { bool bUnsaved = ((IDamageHandlingMethodState)state).IsUnsaved; if (bUnsaved) { return(state.ToCreateDamageHandlingMethod <TCreateDamageHandlingMethod>()); } else { return(state.ToMergePatchDamageHandlingMethod <TMergePatchDamageHandlingMethod>()); } }
public IDamageHandlingMethodState Get(string id) { IDamageHandlingMethodState state = CurrentSession.Get <DamageHandlingMethodState>(id); return(state); }
public DamageHandlingMethodAggregate(IDamageHandlingMethodState state) { _state = state; }
public DamageHandlingMethodStateDtoWrapper(IDamageHandlingMethodState state) { this._state = state; }
public DamageHandlingMethodStateDtoWrapper() { this._state = new DamageHandlingMethodState(); }