Skip to content

Instantly share code, notes, and snippets.

class Program
{
static void Main(string[] args)
{
var config = new MapperConfiguration(c =>
{
c.CreateMap<SourceClass, TargetClass>()
.ForMember(x => x.Vals, o => o.MapFrom((srcCls, trgCls) =>
{
trgCls.Vals.Clear();
@greendimka
greendimka / Code sample A
Last active April 13, 2018 01:01
For a blog "Calculated properties – three strategies"
public class Square {
private int _SideLength;
public int SideLength {
get => _SideLength;
set => _SideLength = value;
}
public int Area {
get => _SideLength * _SideLength;