You can use an extension method.
static class Extensions { public static IList<T> Clone<T>(this IList<T> listToClone) where T: ICloneable { return listToClone.Select(item => (T)item.Clone()).ToList(); } }
Related Posts:
- How to Sort a List
by a property in the object - Remove duplicates from a List
in C# - finding the maximum length of lists in c#
- foreach vs someList.ForEach(){}
- How can I find a specific element in a List
? - Check if list is empty in C#
- C# List
to string with delimiter - Convert a list of strings to a single string
- How to initialize a list of strings (List
) with many string values - Select distinct using linq
- Are 2 dimensional Lists possible in c#?
- IEnumerable vs List – What to Use? How do they work?
- How to easily initialize a list of Tuples?
- Merge two (or more) lists into one, in C# .NET
- Converting from IEnumerable to List
- ArrayList vs List<> in C#
- Deep cloning objects
- finding the maximum length of lists in c#
- How to split() a delimited string to a List
- How to add List<> to a List<> in asp.net [duplicate]
- Sort list by field (C#)
- Linq select objects in list where exists IN (A,B,C)
- C# Convert List
to Dictionary - How do you do a deep copy of an object in .NET?
- How to solve Operator ‘!=’ cannot be applied to operands of type ‘T’ and ‘T’
- Quickest way to compare two generic lists for differences
- How do I generate a random int number?
- An existing connection was forcibly closed by the remote host
- Unexplained crashes related to ntdll.dll
- What is parsing?
- How to fix “HTTP Error 400. The size of the request headers is too long” error from azure cloud services?
- Could not load file or assembly or one of its dependencies
- Adding values to a C# array
- LINQ’s Distinct() on a particular property
- Priority queue in .Net
- What is the difference between int, Int16, Int32 and Int64?
- Adding values to a C# array
- How can I add ” character to a multi line string declaration in C#?
- Unable to connect to web server ‘IIS Express’
- Twilio TwilioRestClient does not contain a definition for SendSmsMessage
- How to convert byte array to string
- ASP.NET Core Dependency Injection error: Unable to resolve service for type while attempting to activate
- System.web.mvc missing
- Nullable object must have a value?
- Sequence contains no elements?
- Best way to generate a random float in C#
- What is clr.dll on .Net framework and what does it do?
- How can I secure passwords stored inside web.config?
- Visual Studio says “Method must have a return type”
- How to Use TextureBrush for painting an Image
- C# compiler error: “not all code paths return a value”
- How to fix “namespace x already contains a definition for x” error? Happened after converting to VS2010
- How do I create a Shared Code project (.shproj)
- OnCollisionEnter2D not being executed?
- The calling thread cannot access this object because a different thread owns it
- Convert JSON String To C# Object
- How can I fix Visual Studio 2015 exception Microsoft.vshup.server.httphostx64.exe has stopped working when run project
- How to convert code from C# to PHP
- Index was out of range. Must be non-negative and less than the size of the collection parameter name:index
- Is dependency injection useful in C++
- Parse Json string in C#
- System.BadImageFormatException: Could not load file or assembly
- Could not load file or assembly ‘Microsoft.Web.Infrastructure,
- Where to place native DLL to use Pocket PC emulator?
- What is the purpose of the vshost.exe file?
- System.ComponentModel.Win32Exception: Access is denied Error
- Excel “External table is not in the expected format.”
- MSSQL Error ‘The underlying provider failed on Open’
- An object reference is required to access a non-static member
- Task vs Thread differences
- There is no ViewData item of type ‘IEnumerable
‘ that has the key country - C# – Rounding Down to Nearest Integer
- How to update the value stored in Dictionary in C#?
- How to write a comment in a Razor view?
- Finalize vs Dispose
- How to download a file from a URL in C#?
- Calculate a MD5 hash from a string
- The model item passed into the dictionary is of type .. but this dictionary requires a model item of type
- How can I get the active screen dimensions?
- WebException (Status: Protocol Error)
- How to add a new row to datagridview programmatically
- Unexpected character encountered while parsing value
- Embedded statement cannot be a declaration or labeled statement
- MailMessage.To.Add() throwing exception : “An invalid character was found in the mail header: ‘,’.”
- How to deserialize xml to object [duplicate]
- How can we prepend strings with StringBuilder?
- C# conditional operator error Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement
- Troubleshooting “program does not contain a static ‘Main’ method” when it clearly does…?
- Unity 5.2.2 changing Visual Studio back to MonoDevelop
- Using FolderBrowserDialog in WPF application
- How to make Check Box List in ASP.Net MVC
- Is it possible to install a C# compiler without Visual Studio?
- Playing a MP3 file in a WinForm application
- The server tag is not well formed error
- Best way to randomize an array with .NET
- Encrypt and decrypt a string in C#?
- Key Value Pair List
- Using .Select and .Where in a single LINQ statement
- How to resize an Image C#
- Unrecognized escape sequence for path string containing backslashes