Exemplo n.º 1
0
        public void StoreMappedId(string id, string mappedId)
        {
            var idMatch = new IdMatch
            {
                Id       = id,
                ItemName = mappedId,
            };

            _storage.TryAddMatch(idMatch);
        }
Exemplo n.º 2
0
        public bool GetMappedId(string id, out string mappedId)
        {
            mappedId = null;

            List <IdMatch> matches = _storage.GetMatches();
            IdMatch        match   = matches.Find(m => string.Equals(m.Id, id, StringComparison.OrdinalIgnoreCase));

            if (match != null)
            {
                mappedId = match.ItemName;
            }

            return(mappedId != null);
        }
Exemplo n.º 3
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (IdMatch.Length != 0)
            {
                hash ^= IdMatch.GetHashCode();
            }
            if (Quantity != 0)
            {
                hash ^= Quantity.GetHashCode();
            }
            if (Person.Length != 0)
            {
                hash ^= Person.GetHashCode();
            }
            if (Username.Length != 0)
            {
                hash ^= Username.GetHashCode();
            }
            return(hash);
        }