Skip to content

Releases: Pawankumar9090/TypeSync

v1.0.6 — Circular Reference Protection & ProjectTo Collection Fix Release Notes

13 Feb 11:45

Choose a tag to compare

🐛 Bug Fixes

  • Map() Circular Reference Stack Overflow — Fixed StackOverflowException when using Map() on entities with circular navigation properties (e.g., Booking → Customer → Bookings). Added thread-safe visited-object tracking to detect and break cycles.

  • ProjectTo ForMember Collection Mapping — Fixed ProjectTo not automatically mapping nested collection properties configured via ForMember/MapFrom when source and destination property names differ (e.g., BookingAddonPestsAddonPests).

  • ProjectTo Circular Type Reference — Fixed StackOverflowException in expression builder when entity types have circular type references. Added type-pair cycle detection.

📦 Full Changelog

https://github.com/Pawankumar9090/TypeSync/blob/main/CHANGELOG.md#106---2026-02-13

v1.0.5 - Enhanced Collection Mapping & LINQ Expression Support

17 Jan 07:34

Choose a tag to compare

TypeSync v1.0.5

🎯 What's New

This release focuses on improving ForMember with MapFrom to properly handle complex LINQ expressions and edge cases.

🐛 Bug Fixes

ForMember MapFrom with LINQ Select Expressions

Fixed an issue where ForMember with MapFrom containing LINQ .Select() expressions did not map nested collection elements.
Before (broken):

csharp
CreateMap<Service, ServiceResponse>()
    .ForMember(dest => dest.ServicePests, opt => opt.MapFrom(src => src.ServicePests.Select(s => s.Pest)));
// ❌ ServicePests was empty or contained unmapped objects

After (fixed):
// ✅ ServicePests now correctly contains mapped PestResponse objects

Min/Max/Sum on Empty Collections
Fixed "Nullable object must have a value" error when using aggregate LINQ methods on empty collections.
Before (broken):

.ForMember(dest => dest.MinPrice, opt => opt.MapFrom(src => src.HouseTypes.Min(x => x.Price)));
// ❌ Threw exception when HouseTypes was empty

After (fixed):
// ✅ Returns default value (0) when collection is empty

LINQ Iterator Type Detection
Enhanced element type detection for LINQ iterator types (e.g., SelectICollectionIterator<,>), ensuring proper collection mapping for deferred LINQ queries.

📦 Installation
dotnet add package TypeSync --version 1.0.5

Full Changelog: v1.0.4...v1.0.5

v1.0.4 - Runtime Property Ignore for ProjectTo

16 Jan 07:15

Choose a tag to compare

This release adds runtime property ignore support to ProjectTo(), bringing feature parity with the Map() method. You can now dynamically exclude properties during LINQ projections without modifying your mapping configuration.

✨ What's New
Runtime Property Filtering for ProjectTo
Filter out sensitive or unnecessary properties at runtime when projecting queries:

// Exclude properties dynamically during projection
var options = new MapOptions("Password", "SSN", "InternalNotes");
var users = await dbContext.Users
    .Where(u => u.IsActive)
    .ProjectTo<UserDto>(config, options)
    .ToListAsync();

Key Features:

  • 🔒 Security-friendly — Easily exclude sensitive fields from API responses
  • 🔄 Consistent API — Same MapOptions class works for both Map and ProjectTo
  • 🔠 Case-insensitive — Property names are matched regardless of casing
  • ✅ Backward compatible — Existing code continues to work without changes

📝 Usage Examples

// Via extension method
var results = query.ProjectTo<UserDto>(config, new MapOptions("Password"));

// Via IMapper
var results = mapper.ProjectTo<UserDto>(query, new MapOptions("SecretKey"));

// Fluent builder pattern
var options = new MapOptions()
    .Ignore("Email")
    .Ignore("Phone")
    .Ignore("InternalId");
var results = query.ProjectTo<UserDto>(config, options);

📋 Installation
dotnet add package TypeSync --version 1.0.4

Full Changelog: v1.0.3...v1.0.4

v1.0.3 - Collection Property Mapping Support

13 Jan 12:22

Choose a tag to compare

🚀 What's New in v1.0.3

This release fixes critical issues with collection property mapping, ensuring seamless mapping of ICollection<T>, List<T>, and other collection types.

🐛 Bug Fixes

  • Collection Property Mapping (Map): Fixed issue where collection properties (e.g., ICollection<AddressDto>ICollection<Address>) were not being mapped when using Map<T>().
  • ProjectTo ICollection Destination: Fixed ProjectTo<T> not mapping collections when destination property is ICollection<T>.

✨ Improvements

  • Full support for mapping collection properties with different element types in both Map<T>() and ProjectTo<T>()
  • Enabled 3 previously skipped tests for nested collection mapping
  • Added new test: ProjectTo_ShouldMapToICollectionDestination

📦 Supported Collection Types

All common collection types now work seamlessly:

  • IEnumerable<T>IEnumerable<T>
  • ICollection<T>ICollection<T>
  • List<T>List<T>
  • T[]T[]
  • Mixed types (e.g., List<T>ICollection<T>)

📖 Documentation

  • Updated README with Collection Property Mapping examples
  • Added ProjectTo (IQueryable Projection) section to README

Full Changelog: v1.0.2...v1.0.3

v1.0.2 - Null Safety and Nested Type Mapping Fixes

12 Jan 13:48

Choose a tag to compare

v1.0.2 (2026-01-12)

Bug Fixes

  • ProjectTo Collection Mapping: Fixed InvalidCastException when projecting to nullable List<T>? destination properties (e.g., ICollection<School>List<SchoolBasicDto>?)

  • Nested Object Mapping: Added support for mapping nested complex types in ProjectTo (e.g., Class → ClassResponse) with proper null checking

  • Null-Safe MapFrom: Replaced try-catch exception handling with NullSafeEvaluator that walks expression trees and checks for null at each property access step, preventing NullReferenceException when using expressions like src.Section.Class.Name

  • Type Conversion: Improved type conversion logic to properly handle assignable types and skip incompatible collection conversions

Internal Changes

  • Added NullSafeEvaluator utility class for safe expression evaluation
  • Added ExpressionReplacer helper for inlining nested projection expressions
  • Added TryGetNestedObjectProjection method for recursive nested type mapping
  • Added IsCollectionType, IsImplicitlyConvertible, and IsNumericType helper methods

v1.0.1 - Compilation Fixes & Ambiguity Resolution

12 Jan 07:45

Choose a tag to compare

Fixed

  • Resolved CS0121 ambiguity error by removing the MapFrom(Func) overload.
  • Fixed CS1593 by implementing a new 3-argument Condition overload: Condition((src, dest, srcMember) => ...).
  • Fixed type inference issues (CS0411) in tests by removing redundant explicit casts.

Changed

  • MapFrom now exclusively uses Expression-based configuration for better property inspection and validation.

v1.0.0 - Initial Release

10 Jan 12:39

Choose a tag to compare

Builds upon the solid foundation of TypeSync, introducing comprehensive mapping capabilities for .NET 8.

Added

  • 🚀 Initial release of TypeSync
  • Convention-based mapping - Automatically maps properties with matching names
  • 🛠 Fluent configuration API - Configure mappings using CreateMap, ForMember, ReverseMap
  • 📦 Profile support - Organize mappings into reusable MappingProfile classes
  • 🌳 Flattening - Map nested properties (e.g., Customer.NameCustomerName)
  • 📚 Collection mapping - Automatic list and array mapping
  • 🔧 Custom value resolvers - Implement IValueResolver for complex transformations
  • Conditional mapping - Skip properties based on conditions
  • 🛡 Null substitution - Provide default values for null properties
  • 💉 Dependency Injection - First-class support for IServiceCollection
  • 🔍 Configuration Validation - Validate mappings with AssertConfigurationIsValid

Security

  • Nested property resolution depth limited to 10 levels
  • Debug logging for troubleshooting without exposing sensitive data