|
1 | | -# <img src="https://github.com/CodeShayk/TurboMapper/blob/master/Images/ninja-icon-16.png" alt="ninja" style="width:30px;"/> TurboMapper v1.0.0 |
| 1 | +# <img src="https://github.com/CodeShayk/TurboMapper/blob/master/Images/ninja-icon-16.png" alt="ninja" style="width:30px;"/> TurboMapper v1.2.0 |
2 | 2 | [](https://badge.fury.io/nu/TurboMapper) [](https://github.com/CodeShayk/TurboMapper/blob/master/LICENSE.md) |
3 | 3 | [](https://github.com/CodeShayk/TurboMapper/releases/latest) |
4 | 4 | [](https://github.com/CodeShayk/TurboMapper/actions/workflows/Master-Build.yml) |
|
10 | 10 | ## Introduction |
11 | 11 | ### What is TurboMapper? |
12 | 12 | `TurboMapper` is a lightweight, high-performance object mapper for .NET that provides both shallow and deep mapping capabilities. It serves as a free alternative to AutoMapper with a simple, intuitive API. |
13 | | -## Getting Started? |
| 13 | + |
| 14 | +## Getting Started |
14 | 15 | ### i. Installation |
15 | 16 | Install the latest version of TurboMapper nuget package with command below. |
16 | 17 |
|
17 | 18 | ``` |
18 | 19 | NuGet\Install-Package TurboMapper |
19 | 20 | ``` |
20 | | -### ii. Developer Guide |
| 21 | + |
| 22 | +### ii. Quick Start Example |
| 23 | +```csharp |
| 24 | +using TurboMapper; |
| 25 | +using Microsoft.Extensions.DependencyInjection; |
| 26 | + |
| 27 | +// Setup |
| 28 | +var services = new ServiceCollection(); |
| 29 | +services.AddTurboMapper(); |
| 30 | +var serviceProvider = services.BuildServiceProvider(); |
| 31 | +var mapper = serviceProvider.GetService<IMapper>(); |
| 32 | + |
| 33 | +// Define models |
| 34 | +public class Source |
| 35 | +{ |
| 36 | + public string Name { get; set; } |
| 37 | + public int Age { get; set; } |
| 38 | +} |
| 39 | + |
| 40 | +public class Target |
| 41 | +{ |
| 42 | + public string Name { get; set; } |
| 43 | + public int Age { get; set; } |
| 44 | +} |
| 45 | + |
| 46 | +// Map single object |
| 47 | +var source = new Source { Name = "John Doe", Age = 30 }; |
| 48 | +var target = mapper.Map<Source, Target>(source); |
| 49 | + |
| 50 | +// Map collections |
| 51 | +var sources = new List<Source> |
| 52 | +{ |
| 53 | + new Source { Name = "Alice", Age = 25 }, |
| 54 | + new Source { Name = "Bob", Age = 32 } |
| 55 | +}; |
| 56 | + |
| 57 | +// Map to IEnumerable<T> |
| 58 | +IEnumerable<Target> targets = mapper.Map<Source, Target>(sources); |
| 59 | + |
| 60 | +// Convert to list if needed |
| 61 | +List<Target> targetList = targets.ToList(); |
| 62 | +``` |
| 63 | + |
| 64 | +### iii. Developer Guide |
21 | 65 | This comprehensive guide provides detailed information on TurboMapper, covering everything from basic concepts to advanced implementations and troubleshooting guidelines. |
22 | 66 |
|
23 | 67 | Please click on [Developer Guide](https://github.com/CodeShayk/TurboMapper/wiki) for complete details. |
24 | 68 |
|
25 | 69 | ## Release Roadmap |
26 | | -This section provides the summary of planned releases with key details about each release. |
| 70 | +This section provides the summary of planned releases with key details about each release. |
27 | 71 |
|
28 | 72 | | Release Version | Release Date | Key Features | Backward Compatibility | Primary Focus | |
29 | 73 | |----------------|--------------|--------------|----------------------|---------------| |
30 | | -| 1.2.0 | October 2025 | Performance improvements (2x+ speed), collection mapping, custom type converters, conditional mapping, transformation functions, configuration validation, improved error messages | ✅ Fully backward compatible | Core improvements, mapping features, custom conversions | |
| 74 | +| 1.2.0 | October 2025 | Performance improvements (2x+ speed), enhanced collection mapping API, custom type converters, conditional mapping, transformation functions, configuration validation, improved error messages | ✅ Fully backward compatible | Core improvements, mapping features, custom conversions | |
31 | 75 | | 1.4.0 | Jan 2026 | Complex nested mapping, circular reference handling, performance diagnostics, generic collection interfaces, interface-to-concrete mapping, dictionary mapping, .NET Standard compatibility | ✅ Fully backward compatible | Advanced mapping, type features, enhanced conversions | |
32 | 76 | | 2.1.0 | Mid 2026 | Pre-compiled mappings, reverse mapping, async transformations, async collection processing, LINQ expressions, projection support, detailed tracing | ❌ Contains breaking changes (new async methods in IMapper) | Next-gen features, async operations, data access integration | |
33 | 77 |
|
34 | 78 | Please see [Release Roadmap](https://github.com/CodeShayk/TurboMapper/blob/master/Release_Roadmap.md) for more details. |
35 | 79 |
|
| 80 | +## Key Features in Release 1.2.0 |
| 81 | +- **Performance Improvements**: Significant performance enhancements (2x+) through compiled expression trees and metadata caching |
| 82 | +- **Enhanced Collection Mapping**: Simplified API with Map method now supporting both single objects and collections |
| 83 | +- **Ignored Properties Option**: Added Ignore method to IMappingExpression to skip properties during mapping |
| 84 | +- **Custom Type Converters Registration**: Added RegisterConverter method to IMapper for custom type conversion functions |
| 85 | +- **Improved Nullable Type Handling**: Enhanced ConvertValue method to handle nullable types properly |
| 86 | +- **Conditional Mapping**: Added When method to IMappingExpression for conditional property mapping |
| 87 | +- **Mapping Transformations**: Added MapWith method for transformation functions during mapping |
| 88 | +- **Comprehensive Type Conversions**: Enhanced ConvertValue with DateTime, TimeSpan, and other common type conversions |
| 89 | +- **Configuration Validation**: Added ValidateMapping and GetMappingErrors methods to IMapper for early validation |
| 90 | +- **Improved Error Messages**: Better debugging information for conversion failures |
| 91 | + |
36 | 92 | ## Contributing |
37 | 93 | We welcome contributions! Please see our Contributing Guide for details. |
38 | 94 | - 🐛 Bug Reports - If you are having problems, please let me know by raising a [new issue](https://github.com/CodeShayk/TurboMapper/issues/new/choose). |
|
0 commit comments