Guest User

Untitled

a guest
Jul 18th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. static void Main(string[] args)
  2. {
  3. Mapper.Initialize(cfg =>
  4. {
  5. cfg.CreateMissingTypeMaps = true;
  6. cfg.ValidateInlineMaps = false;
  7. cfg.CreateMap<Model, ModelDto>();
  8. });
  9.  
  10. System.Collections.Generic.List<Model> models = new List<Model> { new Model(),new Model() };
  11.  
  12. models.AsQueryable().UseAsDataSource().For<ModelDto>().GroupBy(x => x.Id).Dump();
  13. }
  14.  
  15. public class Model
  16. {
  17. public int Id { get; set; }
  18. }
  19.  
  20. public class ModelDto
  21. {
  22. public int Id { get; set; }
  23. }
Add Comment
Please, Sign In to add comment