henkmollema / Dommel

CRUD operations with Dapper made simple.
MIT License
611 stars 99 forks source link

Dapper.FluentMap API error #306

Closed x0gundam1133 closed 2 months ago

x0gundam1133 commented 2 months ago

This API needs to be updated in the FluentMapConstructionExtensions.cs file in order to be used.

        public static FluentMapConfiguration ApplyMapsFromAssemblies(this FluentMapConfiguration configuration,  params Assembly[] assemblies)
        {
            if (assemblies == null)
            {
                throw new ArgumentNullException(nameof(assemblies));
            }

            var entityMapTypes = FindTypesImplementingIEntityMap(assemblies);

            if (!entityMapTypes.Any())
            {
                return configuration;
            }

            EnsureNoDuplicateMapping(entityMapTypes);

            AddMaps(configuration, entityMapTypes);

            return configuration;
        }

like this:

FluentMapper.Initialize(config =>
{
    config.ForDommel();
    //config.AddMap(new TestInfoMap());
    config.ApplyMapsFromAssemblies(Assembly.GetExecutingAssembly());
});
x0gundam1133 commented 2 months ago

Can you also add Dapper.FluentMap.Dommel's Dommel version has been updated to 3.1.1

henkmollema commented 2 months ago

Dapper.FluentMap is a different package/repository which has been archived last year. I won't be updating it, but feel free to fork and update it yourself.