This page is a brief collection of various C# code snippets.

Working with Lists

C

Working with Lists

Suppose you have a List that you want to make another List from? This could be useful for an API when serializing Json from an object prior to sending it to a mobile app. public class ListExample { public static List GetAuthorSelect() { List authorSelect = new List(); List author = new Data.AccessLayer.GetAuthors(); { //create and copy the items we want to into a light list authorSelect = author.ConvertAll(x => new AuthorSelect { Id = x.