Example #1
0
        public ISet <int> Calculate(XComponent.Order.UserObject.Order publicMember, Object internalMember)
        {
            var hashcodes = new HashSet <int>();
            var hashCodeForPropertyIdOfPublicMember = publicMember.Id != null?HashcodeHelper.GetXcHashCode(publicMember.Id) : 0;

            hashcodes.Add(0);
            hashcodes.Add(hashCodeForPropertyIdOfPublicMember);
            return(hashcodes);
        }
Example #2
0
        public IEnumerable <int> Calculate(object rawEvent)
        {
            var typedEvent = rawEvent as XComponent.Trade.UserObject.TradeExecution;

            if (typedEvent == null)
            {
                _logger.Error(string.Format("{0}EventHashCodeCalculator should be called with event {1} instead of {2}. This may be due to a generation problem.", "TradeExecution", "XComponent.Trade.UserObject.TradeExecution", rawEvent != null ? rawEvent.GetType().ToString() : string.Empty));
                yield break;
            }
            var hashCodeForPropertyOrderIdOfEvent = typedEvent.OrderId != null?HashcodeHelper.GetXcHashCode(typedEvent.OrderId) : 0;

            yield return(hashCodeForPropertyOrderIdOfEvent);
        }