Browse Source

Update docs/en/Community-Articles/2024-05-09-what-is-object-to-object-mapping/post.md

Co-authored-by: Engincan VESKE <enginveske@gmail.com>
pull/19759/head
Enes Doner 2 years ago
committed by GitHub
parent
commit
1e12280a49
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      docs/en/Community-Articles/2024-05-09-what-is-object-to-object-mapping/post.md

2
docs/en/Community-Articles/2024-05-09-what-is-object-to-object-mapping/post.md

@ -116,7 +116,7 @@ CreateMap<Customer, CustomerGetDto>().ForMember(c=>c.FullName,opt=> opt.MapFrom(
.ForMember(c=>c.Age, opt=> opt.MapFrom(src=> DateTime.UtcNow.Year -src.BirthDay.Year));
````
This script concatenates and matches **FirstName** and **LastName** in the **FullName** field and subtracts **BirthDate** from today's year and assigns it to the customer's **Age**
This configuration concatenates and matches **FirstName** and **LastName** properties into the **FullName** property and subtracts **BirthDate** from today's year and assigns it to the customer's **Age**.
After these configurations, if you make a request to the relevant endpoint, the output will look like as below:
![Swagger](./images/swagger2.png)

Loading…
Cancel
Save