/// <summary> /// Free the mapping, no further changes may be made. /// </summary> /// <remarks> /// <para>Called by the mapping provider when it's being added to it.</para> /// </remarks> public void Freeze() { _builder = CommandBuilderFactory.Create(this); foreach (var kvp in _mappings.Where(x => x.Value.IsPrimaryKey)) { _keys.Add(kvp); } }
/// <summary> /// Free the mapping, no further changes may be made. /// </summary> /// <remarks> /// <para>Called by the mapping provider when the mapping have been added to it.</para> /// <para> /// The purpose is to allow the mapping implementations to do post process once the mappings have been fully /// configured. /// </para> /// </remarks> public void Freeze() { _builder = CommandBuilderFactory.Create(this); foreach (var kvp in Properties.Where(x => x.Value.IsPrimaryKey)) { _keys.Add(kvp); } if (_keys.Count != 0) { return; } if (Properties.ContainsKey("Id")) { _keys.Add("Id", Properties["Id"]); } }