Exemplo n.º 1
0
        /// <summary>
        /// Gets the address item for relation.
        /// </summary>
        /// <param name="relationId">The relation identifier.</param>
        /// <param name="addressId">The address identifier.</param>
        /// <returns>Address.</returns>
        public Address GetAddressItemForRelation(string relationId, string addressId)
        {
            var     addressItems = GetAddressItemsForRelation(relationId);
            Address address      = (from a in addressItems where a.Id == addressId select a).FirstOrDefault();

            if (address == null)
            {
                address = new Address();
                address.AddError(String.Format("Address with relationId '{0}' and addressId '{1}' not found", relationId, addressId));
            }
            return(address);
        }