Skip to content

Commit

Permalink
Updated Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
DXSdata committed Feb 25, 2020
1 parent 5387d55 commit 8d83a9b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
1 change: 0 additions & 1 deletion MapperTest/Program.cs
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using AutoMapper.DXSdata;

namespace MapperTest
Expand Down
17 changes: 15 additions & 2 deletions README.md
Expand Up @@ -27,6 +27,9 @@ namespace MapperTest
//Mapper.CustomMappings.Add(typeof(MyCustomSubclass), typeof(MyCustomSubclassViewModel)); //or:
//Mapper.CustomMappings.Add<MyCustomSubclass, MyCustomSubclassViewModel>();
//Optional advanced configuration; see below
Mapper.OnConfiguring += AdvancedConf;

var list1 = new List<MyClass1>
{
new MyClass1(),
Expand All @@ -43,11 +46,21 @@ namespace MapperTest

var dto6 = list1.AsQueryable().ProjectTo<List<MyClass2>>(); //for DB queries
var dto7 = Mapper.ProjectTo<List<MyClass2>>(list1.AsQueryable());




}

static void AdvancedConf(object sender, MapperConfiguringEventArgs e)
{
//e.Configuration.CreateMap<MyViewModel, My>().ForMember(my => my.MyEquipment, opt => opt.MapFrom(dto => MyUnflattenMethod<MyEquipment>(dto.Id, dto.Equipment)));
//e.Configuration.CreateMap<My, MyViewModel>().ForMember(dto => dto.Equipment, opt => opt.MapFrom(my => MyFlattenMethod(my.MyEquipment)));
}



}


}

```
Expand Down

0 comments on commit 8d83a9b

Please sign in to comment.