To ignore a property during object mapping using AutoMapper in C#, you can use the ForMember()
method in the MapperConfiguration
class.
Here's an example:
main.cs752 chars25 lines
In the above example, the Description
property from the Source
class is ignored during object mapping to the Destination
class using the ForMember()
method with the opt.Ignore()
statement.
gistlibby LogSnag