Bug in AWS.SLAM.Configuration.XmlSqlDataMapping GetTypeAssociations(...)

Nov 29, 2010 at 9:42 PM

The code:


guidId = new Guid(id);

                selectedNode = (from typeNode in _configXml.Root.Elements().Where(mapping =>
                                   mapping.Name == "DataMapping" &&
                                   (String.IsNullOrEmpty(_siteCollectionName) ?
                                   (mapping.Attribute("SiteCollection") == null ||
                                   String.IsNullOrEmpty(mapping.Attribute("SiteCollection").Value)) :
                                   (mapping.Attribute("SiteCollection") != null &&
                                   mapping.Attribute("SiteCollection").Value.ToLower() == _siteCollectionName.ToLower()))).Elements()
                                where typeNode.Attribute("ID") != null &&
                                      typeNode.Attribute("ID").Value == guidId.ToString()
                                select typeNode).DefaultIfEmpty().First();

it runs correctly, but the comparison:

typeNode.Attribute("ID").Value == guidId.ToString()

should be a CASE-INSENSITIVE comparison, or convert the typenode attribute to a Guid object before comparing.

The fact of the matter is, I discovered this while trying to bind a mapping to a list with a specific ID. I got the ID from a url in the web browser, and it was upper-case. After some time debugging the code, I found the ID attribute worked when it was re-typed in LOWER CASE.






Nov 30, 2010 at 12:10 AM

Good catch.  We'll include it in the next release.