Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is no ability in FluentConfig to use or to clear cached assemblies #299

Open
misiam opened this issue Feb 13, 2014 · 0 comments
Open

Comments

@misiam
Copy link

misiam commented Feb 13, 2014

In this code:

https://github.com/igor-tkachev/bltoolkit/blob/master/Source/Mapping/Fluent/FluentConfig.cs

public void MapingFromAssembly(Assembly assembly)
            {
                ExtensionList res;
                if (!_hash.TryGetValue(assembly, out res))
                {
                    res = new ExtensionList();
                    _hash.Add(assembly, res);

                    string fluentType = typeof(IFluentMap).FullName;
                    var mapTypes = from type in assembly.GetTypes()
                               where type.IsClass && !type.IsAbstract && !type.IsGenericType
                                     && (null != type.GetInterface(fluentType)) // Is IFluentMap
                                     && (null != type.GetConstructor(new Type[0])) // Is defaut ctor
                               select type;
                    foreach (var fluentMapType in mapTypes)
                    {
                        MapingFromType(fluentMapType);
                    }
                }
                //FluentMapHelper.MergeExtensions(res, ref this._extensions);
            }

"MapingFromAssemblyOf" executes code only once for each assembly, so such code will not work properly:

FluentConfig.Configure(mappingSchema).MapingFromAssemblyOf<MSSQLInitialize>();

if there is no ability to make "//FluentMapHelper.MergeExtensions(res, ref this._extensions);" code works, maybe it is possible to remove "if" condition and process every assembly multiple times?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant