protected override void OnApplying(IEvent e) { if (e is IAttributeSetInstanceStateCreated) { var eC = e as IAttributeSetInstanceStateCreated; eC.Hash = AttributeSetInstancePropertyUtils.GetHash(eC); } base.OnApplying(e); }
public override string GetOrGenerateId(ICreateAttributeSetInstance command, out bool reused) { string hash = AttributeSetInstancePropertyUtils.GetHash(command); command.Hash = hash; var old = AttributeSetInstanceStateRepository.GetFirst(new KeyValuePair <string, object>("Hash", hash)); if (old != null) { if (AttributeSetInstancePropertyUtils.Equals(command, old)) { reused = true; return(old.AttributeSetInstanceId); } } reused = false; return(GetNextId()); }
public override string GenerateId(ICreateAttributeSetInstance command) { string hash = AttributeSetInstancePropertyUtils.GetHash(command); return(hash); }