Skip to content

Instantly share code, notes, and snippets.

@bizunas
Created July 18, 2018 06:17
Show Gist options
  • Save bizunas/d8e8e20530de32d8537988d1de3ee15b to your computer and use it in GitHub Desktop.
Save bizunas/d8e8e20530de32d8537988d1de3ee15b to your computer and use it in GitHub Desktop.
static void Main(string[] args)
{
Mapper.Initialize(cfg =>
{
cfg.CreateMissingTypeMaps = true;
cfg.ValidateInlineMaps = false;
cfg.CreateMap<Model, ModelDto>();
});
System.Collections.Generic.List<Model> models = new List<Model> { new Model(),new Model() };
models.AsQueryable().UseAsDataSource().For<ModelDto>().GroupBy(x => x.Id).Dump();
}
public class Model
{
public int Id { get; set; }
}
public class ModelDto
{
public int Id { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment