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 bool Equals(ICreateAttributeSetInstance command, IAttributeSetInstanceState state) { return(AttributeSetInstancePropertyUtils.Equals(command, state)); }