I've come across these questions: Merge two objects using AutoMapper , C# Merge objects with automapper, and this one seemed to the most helpful: Automapper - Multi object source and one destination, however it does not seem to be using version 10 of the AutoMapper code. Everything has it's own errors with the latest version of AutoMapper.
Additionally, I just started on StackOverflow so I cannot comment yet on that question. I can only ask my own.
It appears in AutoMapper that you have to use something called a "Profile" now (see their documentation here: https://docs.automapper.org/en/stable/Dependency-injection.html#asp-net-core). Therefore, my question is, how would one create a "Merge" type of mapping in version 10 of AutoMapper in .Net 5 or greater (so using Dependency Injection, etc.)
As a request, if you give specific code snippets, can you give where that code should go as well, such as "In Startup.cs" or "Create a new class", etc.
Since AutoMapper is so new to me, some of the library lingo is still new to me.
Thank you all for your help.
UPDATE on 9/21/2021 at 11 am EDT Some context on why I'm trying to merge: This is the scenario that I have generalized to highlight the main points:
I have 2 data sources. One I contact via API. The other is via MsSql.
The API stores Person Information (names, addresses), whereas the Sql stores ProgramPerson (PersonId from above, License # for Program, DateOfLicense, etc.)
Therefore, I would like to get information from the API, then information from the Sql Server and end up with one C# Model. That way when I need to update a Person, I can pass around 1 model that implements the interfaces for the Sql and the Api calls.