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 .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:

- name: Pack
run: |
dotnet pack src/MyAutoMapper/SmAutoMapper.csproj \
dotnet pack src/SmAutoMapper/SmAutoMapper.csproj \
-c Release \
--no-build \
-p:Version=${{ steps.version.outputs.VERSION }} \
Expand Down
18 changes: 9 additions & 9 deletions README-ru.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# MyAutoMapper
# SmAutoMapper

> **[English version (README.md)](README.md)**

Expand Down Expand Up @@ -194,7 +194,7 @@ builder.Services.AddMapping(

## Как работают параметризованные проекции

Это ключевая инновация библиотеки. Обычные подходы (string interpolation, замена констант) ломают кэш планов запросов EF Core. MyAutoMapper использует closure-паттерн — тот же, что C# компилятор генерирует для замыканий.
Это ключевая инновация библиотеки. Обычные подходы (string interpolation, замена констант) ломают кэш планов запросов EF Core. SmAutoMapper использует closure-паттерн — тот же, что C# компилятор генерирует для замыканий.

### Этап конфигурации

Expand Down Expand Up @@ -234,7 +234,7 @@ builder.Services.AddMapping(

## Пример: Web API с локализацией

Проект `samples/MyAutoMapper.WebApiSample` — рабочий пример ASP.NET Core Web API с EF Core SQLite и параметризованной локализацией.
Проект `samples/SmAutoMapper.WebApiSample` — рабочий пример ASP.NET Core Web API с EF Core SQLite и параметризованной локализацией.

### Профиль

Expand Down Expand Up @@ -325,7 +325,7 @@ SQL-запросом.
### Запуск примера

```bash
cd samples/MyAutoMapper.WebApiSample
cd samples/SmAutoMapper.WebApiSample
dotnet run
# Swagger UI: http://localhost:5000/swagger
```
Expand All @@ -346,21 +346,21 @@ dotnet run

```bash
# Unit-тесты
dotnet test tests/MyAutoMapper.UnitTests
dotnet test tests/SmAutoMapper.UnitTests

# Интеграционные тесты (EF Core SQLite)
dotnet test tests/MyAutoMapper.IntegrationTests
dotnet test tests/SmAutoMapper.IntegrationTests

# Все тесты
dotnet test
```

## Бенчмарки

Сравнение **MyAutoMapper** vs **AutoMapper** (16.1.1) vs **Mapster** (10.0.3) vs ручной маппинг.
Сравнение **SmAutoMapper** vs **AutoMapper** (16.1.1) vs **Mapster** (10.0.3) vs ручной маппинг.

```bash
cd tests/MyAutoMapper.Benchmarks
cd tests/SmAutoMapper.Benchmarks

# Все бенчмарки (5-15 мин)
dotnet run -c Release -- --filter *
Expand All @@ -386,7 +386,7 @@ dotnet build
dotnet test

# Запуск Web API примера
cd samples/MyAutoMapper.WebApiSample
cd samples/SmAutoMapper.WebApiSample
dotnet run

# Упаковка для NuGet
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# MyAutoMapper
# SmAutoMapper

> **[Русская версия (README-ru.md)](README-ru.md)**

Expand Down Expand Up @@ -192,7 +192,7 @@ All mappings validated at registration. On errors: `MappingValidationException`

## How Parameterized Projections Work

This is the library's key innovation. Common approaches (string interpolation, constant replacement) break EF Core's query plan cache. MyAutoMapper uses the closure pattern — the same one the C# compiler generates for closures.
This is the library's key innovation. Common approaches (string interpolation, constant replacement) break EF Core's query plan cache. SmAutoMapper uses the closure pattern — the same one the C# compiler generates for closures.

### Configuration Phase

Expand Down Expand Up @@ -232,7 +232,7 @@ This is the library's key innovation. Common approaches (string interpolation, c

## Example: Web API with Localization

The project `samples/MyAutoMapper.WebApiSample` is a working ASP.NET Core Web API with EF Core SQLite and parameterized localization.
The project `samples/SmAutoMapper.WebApiSample` is a working ASP.NET Core Web API with EF Core SQLite and parameterized localization.

### Profile

Expand Down Expand Up @@ -323,7 +323,7 @@ a single SQL query.
### Running the Example

```bash
cd samples/MyAutoMapper.WebApiSample
cd samples/SmAutoMapper.WebApiSample
dotnet run
# Swagger UI: http://localhost:5000/swagger
```
Expand All @@ -344,21 +344,21 @@ dotnet run

```bash
# Unit tests
dotnet test tests/MyAutoMapper.UnitTests
dotnet test tests/SmAutoMapper.UnitTests

# Integration tests (EF Core SQLite)
dotnet test tests/MyAutoMapper.IntegrationTests
dotnet test tests/SmAutoMapper.IntegrationTests

# All tests
dotnet test
```

## Benchmarks

Compares **MyAutoMapper** vs **AutoMapper** (16.1.1) vs **Mapster** (10.0.3) vs manual mapping.
Compares **SmAutoMapper** vs **AutoMapper** (16.1.1) vs **Mapster** (10.0.3) vs manual mapping.

```bash
cd tests/MyAutoMapper.Benchmarks
cd tests/SmAutoMapper.Benchmarks

# All benchmarks (5-15 min)
dotnet run -c Release -- --filter *
Expand Down Expand Up @@ -400,13 +400,13 @@ dotnet build
dotnet test

# Run Web API example
cd samples/MyAutoMapper.WebApiSample
cd samples/SmAutoMapper.WebApiSample
dotnet run

# Pack for NuGet
dotnet pack -c Release

dotnet pack src/MyAutoMapper/SmAutoMapper.csproj -c Release -o ./nupkg
dotnet pack src/SmAutoMapper/SmAutoMapper.csproj -c Release -o ./nupkg
```

## License
Expand Down
10 changes: 5 additions & 5 deletions SmAutoMapperSol.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<File Path="README.md" />
</Folder>
<Folder Name="/src/">
<Project Path="src/MyAutoMapper/SmAutoMapper.csproj" />
<Project Path="src/SmAutoMapper/SmAutoMapper.csproj" />
</Folder>
<Folder Name="/samples/">
<Project Path="samples/MyAutoMapper.WebApiSample/MyAutoMapper.WebApiSample.csproj" />
<Project Path="samples/SmAutoMapper.WebApiSample/SmAutoMapper.WebApiSample.csproj" />
</Folder>
<Folder Name="/tests/">
<Project Path="tests/MyAutoMapper.Benchmarks/MyAutoMapper.Benchmarks.csproj" />
<Project Path="tests/MyAutoMapper.IntegrationTests/MyAutoMapper.IntegrationTests.csproj" />
<Project Path="tests/MyAutoMapper.UnitTests/MyAutoMapper.UnitTests.csproj" />
<Project Path="tests/SmAutoMapper.Benchmarks/SmAutoMapper.Benchmarks.csproj" />
<Project Path="tests/SmAutoMapper.IntegrationTests/SmAutoMapper.IntegrationTests.csproj" />
<Project Path="tests/SmAutoMapper.UnitTests/SmAutoMapper.UnitTests.csproj" />
</Folder>
</Solution>
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using Microsoft.AspNetCore.Mvc;
using MyAutoMapper.WebApiSample.Data;
using MyAutoMapper.WebApiSample.Entities;
using MyAutoMapper.WebApiSample.ViewModels;
using SmAutoMapper.WebApiSample.Data;
using SmAutoMapper.WebApiSample.Entities;
using SmAutoMapper.WebApiSample.ViewModels;
using SmAutoMapper.Extensions;
using SmAutoMapper.Runtime;

namespace MyAutoMapper.WebApiSample.Controllers;
namespace SmAutoMapper.WebApiSample.Controllers;

[ApiController]
[Route("api/[controller]")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using MyAutoMapper.WebApiSample.Data;
using MyAutoMapper.WebApiSample.ViewModels;
using SmAutoMapper.WebApiSample.Data;
using SmAutoMapper.WebApiSample.ViewModels;
using SmAutoMapper.Extensions;

namespace MyAutoMapper.WebApiSample.Controllers;
namespace SmAutoMapper.WebApiSample.Controllers;

[ApiController]
[Route("api/[controller]")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Microsoft.EntityFrameworkCore;
using MyAutoMapper.WebApiSample.Entities;
using SmAutoMapper.WebApiSample.Entities;

namespace MyAutoMapper.WebApiSample.Data;
namespace SmAutoMapper.WebApiSample.Data;

public class AppDbContext : DbContext
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using MyAutoMapper.WebApiSample.Entities;
using SmAutoMapper.WebApiSample.Entities;

namespace MyAutoMapper.WebApiSample.Data;
namespace SmAutoMapper.WebApiSample.Data;

public static class SeedData
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace MyAutoMapper.WebApiSample.Entities;
namespace SmAutoMapper.WebApiSample.Entities;

public class Category
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace MyAutoMapper.WebApiSample.Entities;
namespace SmAutoMapper.WebApiSample.Entities;

public class Product
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//namespace MyAutoMapper.WebApiSample.Entities;
//namespace SmAutoMapper.WebApiSample.Entities;

//public class SpCategory
//{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using MyAutoMapper.WebApiSample.Entities;
using MyAutoMapper.WebApiSample.ViewModels;
using SmAutoMapper.WebApiSample.Entities;
using SmAutoMapper.WebApiSample.ViewModels;
using SmAutoMapper.Configuration;

namespace MyAutoMapper.WebApiSample.Profiles;
namespace SmAutoMapper.WebApiSample.Profiles;

public class CategoryViewModelProfile : MappingProfile
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using MyAutoMapper.WebApiSample.Entities;
using MyAutoMapper.WebApiSample.ViewModels;
using SmAutoMapper.WebApiSample.Entities;
using SmAutoMapper.WebApiSample.ViewModels;
using SmAutoMapper.Configuration;

namespace MyAutoMapper.WebApiSample.Profiles;
namespace SmAutoMapper.WebApiSample.Profiles;

/// <summary>
/// Parameterized projection: Product → ProductViewModel.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.EntityFrameworkCore;
using MyAutoMapper.WebApiSample.Data;
using MyAutoMapper.WebApiSample.Profiles;
using SmAutoMapper.WebApiSample.Data;
using SmAutoMapper.WebApiSample.Profiles;
using SmAutoMapper.Extensions;

var builder = WebApplication.CreateBuilder(args);
Expand All @@ -9,7 +9,7 @@
builder.Services.AddDbContext<AppDbContext>(options =>
options.UseSqlite("Data Source=sample.db"));

// MyAutoMapper — auto-scan assembly for all MappingProfile subclasses
// SmAutoMapper — auto-scan assembly for all MappingProfile subclasses
builder.Services.AddMapping(typeof(Program).Assembly);

builder.Services.AddControllers();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"profiles": {
"MyAutoMapper.WebApiSample": {
"SmAutoMapper.WebApiSample": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\MyAutoMapper\SmAutoMapper.csproj" />
<ProjectReference Include="..\..\src\SmAutoMapper\SmAutoMapper.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace MyAutoMapper.WebApiSample.ViewModels;
namespace SmAutoMapper.WebApiSample.ViewModels;

public class CategoryViewModel
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace MyAutoMapper.WebApiSample.ViewModels;
namespace SmAutoMapper.WebApiSample.ViewModels;

public class ProductViewModel
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ internal sealed class ClosureHolderFactory

static ClosureHolderFactory()
{
var assemblyName = new AssemblyName("MyAutoMapper.DynamicHolders");
var assemblyName = new AssemblyName("SmAutoMapper.DynamicHolders");
var assemblyBuilder = AssemblyBuilder.DefineDynamicAssembly(
assemblyName, AssemblyBuilderAccess.Run);
ModuleBuilder = assemblyBuilder.DefineDynamicModule("MainModule");
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="MyAutoMapper.UnitTests" />
<InternalsVisibleTo Include="SmAutoMapper.UnitTests" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using SmAutoMapper.Configuration;
using SmAutoMapper.Runtime;

namespace MyAutoMapper.Benchmarks;
namespace SmAutoMapper.Benchmarks;

[MemoryDiagnoser]
[Orderer(SummaryOrderPolicy.FastestToSlowest)]
Expand All @@ -18,7 +18,7 @@ public class ComplexMappingBenchmark
[GlobalSetup]
public void Setup()
{
// MyAutoMapper setup
// SmAutoMapper setup
var builder = new MappingConfigurationBuilder();
builder.AddProfile<MyComplexProfile>();
var config = builder.Build();
Expand Down Expand Up @@ -68,7 +68,7 @@ public ComplexDest Manual()
}

[Benchmark]
public ComplexDest MyAutoMapper()
public ComplexDest SmAutoMapper()
{
return _myMapper.Map<ComplexSource, ComplexDest>(_source);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Microsoft.Extensions.Logging.Abstractions;
using SmAutoMapper.Configuration;

namespace MyAutoMapper.Benchmarks;
namespace SmAutoMapper.Benchmarks;

/// <summary>
/// Measures the one-time cost of configuring each mapper library
Expand All @@ -15,7 +15,7 @@ namespace MyAutoMapper.Benchmarks;
public class ConfigurationBenchmark
{
[Benchmark(Baseline = true)]
public object MyAutoMapper_Configure()
public object SmAutoMapper_Configure()
{
var builder = new MappingConfigurationBuilder();
builder.AddProfile<ConfigBenchmarkProfile>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using SmAutoMapper.Configuration;
using SmAutoMapper.Runtime;

namespace MyAutoMapper.Benchmarks;
namespace SmAutoMapper.Benchmarks;

[MemoryDiagnoser]
[Orderer(SummaryOrderPolicy.FastestToSlowest)]
Expand All @@ -18,7 +18,7 @@ public class FlatteningBenchmark
[GlobalSetup]
public void Setup()
{
// MyAutoMapper setup — flattening convention handles AddressStreet, AddressCity, etc.
// SmAutoMapper setup — flattening convention handles AddressStreet, AddressCity, etc.
var builder = new MappingConfigurationBuilder();
builder.AddProfile<MyFlatteningProfile>();
var config = builder.Build();
Expand Down Expand Up @@ -69,7 +69,7 @@ public FlattenDest Manual()
}

[Benchmark]
public FlattenDest MyAutoMapper()
public FlattenDest SmAutoMapper()
{
return _myMapper.Map<FlattenSource, FlattenDest>(_source);
}
Expand Down
Loading
Loading