private void CheckUriProperties(RestEntityConfigurationBase config) { var props = config.GetProperties(); bool hasPrimaryKey = false; var mappingNames = new HashSet <string>(); foreach (var p in props) { hasPrimaryKey |= p.IsPrimaryKey; // TODO: This check should be in the RestEntityConfiguration if (mappingNames.Contains(p.MappingName)) { string msg = String.Format( "The mapping '{0}' has been mapped to more than one property.", p.MappingName); throw new Exception(msg); } mappingNames.Add(p.MappingName); } if (!hasPrimaryKey) { string msg = String.Format("No primary key(s) defined for type {0}", config.GetBaseType().FullName); throw new Exception(msg); } }
public RequestBuilder(RestEntityConfigurationBase configuration) { m_config = configuration; }