CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of AutoMapper LinqPad C
C#
void Main()
{
    AutoMapper.Mapper.CreateMap<Contact, KeyValuePair<Guid, string>>()
        .ConstructUsing(x => new KeyValuePair<Guid, string>(x.Id, x.FullName));
 
    //var contacts = ContactRepository.GetAll(); // Returns IList<Contact>
    var contacts = new List<Contact> {
        new Contact { Id = Guid.NewGuid(), FullName = "Joe Bob" },
        new Contact { Id = Guid.NewGuid(), FullName = "Sally Jones" },
    };
by mellamokb   July 15, 2011 @ 2:54pm
301 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate