[ACCEPTED]-How do you do alias in Select method (LINQ)-linq

Accepted answer
Score: 25

It's called a "Projection", just select 1 a new anonymous type.

var projection = data.Select( x => new { FieldName = x.Property } );
Score: 2

You are looking to select into a new anonymous 1 type.

var providers = EMRRepository.GetProviders().Select(x => new { Name = x });

More Related questions