Exemplo n.º 1
0
 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());
        }
Exemplo n.º 3
0
 public override bool Equals(ICreateAttributeSetInstance command, IAttributeSetInstanceState state)
 {
     return(AttributeSetInstancePropertyUtils.Equals(command, state));
 }
Exemplo n.º 4
0
        public override string GenerateId(ICreateAttributeSetInstance command)
        {
            string hash = AttributeSetInstancePropertyUtils.GetHash(command);

            return(hash);
        }