Skip to content

Instantly share code, notes, and snippets.

@SpaceShot
Created July 20, 2012 18:28
Show Gist options
  • Save SpaceShot/3152437 to your computer and use it in GitHub Desktop.
Save SpaceShot/3152437 to your computer and use it in GitHub Desktop.
Linq query with customer order by to an anonymous type
XdsServicesDataContext xds = new XdsServicesDataContext();
var query = xds.SXAXDSCustomers.AsEnumerable().OrderBy(c => c.Oid, new OidComparer())
.Select( x =>
new {
Name = x.Name,
Oid = x.Oid,
UserId = x.UserId,
AllowAutoPatientRegistration = x.AllowAutoPatientRegistration,
MembershipUsersCollection = Membership.FindUsersByName(x.UserId)
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment