Custom Property Mapping

ℹ️ Description: Use ForMember() to map properties with custom logic (e.g., FullName = FirstName + LastName).

Mapping Result

Property Value
Id 1
First Name John
Last Name Doe
Full Name Computed
Email john.doe@example.com
Date of Birth Formatted
Age Calculated 0 years
Total Orders 0
Status Resolver
💻 Code Used
// Create source object
var user = new User
{
    Id = 1,
    FirstName = "John",
    LastName = "Doe",
    Email = "john.doe@example.com",
    DateOfBirth = new DateTime(1990, 1, 1),
    // ... other properties
};

// Map to DTO using AutoMapper
var userDTO = _mapper.Map<UserDTO>(user);

// That's it! AutoMapper handles all the mapping logic