public static void MergeExtensions(ExtensionList fromExt, ref ExtensionList toExt) { foreach (var kv in fromExt) { TypeExtension toType; if (toExt.TryGetValue(kv.Key, out toType)) { MergeExtensions(kv.Value, ref toType); } else { toExt.Add(kv.Key, kv.Value); } } }
/// <summary> /// Apply fluent settings to ExtensionList /// </summary> /// <param name="extensions"></param> public void MapTo(ExtensionList extensions) { var ext = this._typeExtension; TypeExtension oldExt; if (extensions.TryGetValue(ext.Name, out oldExt)) { FluentMapHelper.MergeExtensions(ext, ref oldExt); } else { extensions.Add(ext); } this.EachChilds(m => m.MapTo(extensions)); }