Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ internal class ArticleResponseToEntityMap : ICoreMapHandler<ArticleResponse, Art
Description = data.Description,
Id = data.Id,
Title = data.Title,
WrittenBy = alsoMap.MapTo<AuthorResponse, AuthorEntity>(data.Author)
WrittenBy = alsoMap.MapEach(data.Author).To<AuthorEntity>()
};
}
```
Expand Down
5 changes: 5 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
README: https://github.com/mshimshon/CoreMap

# v2.0.0
## Breaking Changes
- `AddCoreMap` `scanAssemblies` is no longer supporting Types but directly takes assemblies.

# v1.1.2
- Minor Fixes

Expand Down
4 changes: 2 additions & 2 deletions src/CoreMap/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<GlobalVersion>1.1.2</GlobalVersion>
<GlobalCopyright>Maksim Shimshon 2026</GlobalCopyright>
<GlobalVersion>2.0.0</GlobalVersion>
<GlobalCopyright>Maksim Shimshon © 2026</GlobalCopyright>
</PropertyGroup>
</Project>
8 changes: 5 additions & 3 deletions src/CoreMap/RegisterServiceExt.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
using CoreMap.Engine;
using Microsoft.Extensions.DependencyInjection;
using System.Reflection;

namespace CoreMap;

public static class RegisterServiceExt
{
public static IServiceCollection AddCoreMap(this IServiceCollection services, Action<CoreMapConfiguration> options, Type[]? scanAssemblies = default)
public static IServiceCollection AddCoreMap(this IServiceCollection services, Action<CoreMapConfiguration> options, Assembly[]? scanAssemblies = default)
{
var config = new CoreMapConfiguration();
options(config);
services.AddScoped<ICoreMap, CoreMapper>();
foreach (var assembly in scanAssemblies ?? new Type[] { })
foreach (var assembly in scanAssemblies ?? new Assembly[] { })
{
// Find all types implementing ICoreMapper<,>
var mapperTypes = assembly.Assembly.GetTypes()
var mapperTypes = assembly.GetTypes()
.Where(t => !t.IsAbstract && !t.IsInterface)
.SelectMany(t => t.GetInterfaces()
.Where(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(ICoreMapHandler<,>))
Expand Down