c# - Ignore a property in AutoMapper? -
i'm using automapper copy 1 object properties other , later update in database using ef.
question how tell automapper copy every property ignore particular property (in case id). i'm new automapper , have done code. don't have other configurations or use of automap in project.
mapper.map(lead, existinglead);
i have downloaded automapper form here https://github.com/automapper/automapper
on mapper.createmap<type1, type2>()
can use either
.forsourcemember(x => x.id, opt => opt.ignore())
or
.formember(x => x.id, opt => opt.ignore())
Comments
Post a Comment