score:3
Accepted answer
private list<customer> getcustomerlist() {
list<customer> customers = new list<customers>();
customer bob = new customer();
bob.name = "bob";
bob.id = 1;
customers.add(bob);
customer fred = new customer();
fred.name = "fred";
fred.id = 2;
customers.add(fred);
return customers;
}
Source: stackoverflow.com
Related Query
- source code for LINQ 101 samples
- Is there a bug in this code from 101 LINQ Samples on MSDN? (Update: Fixed)
- Has anyone done the Linq 101 samples with Lambda syntax?
- Suggestions for designing complex LINQ code
- How to reuse a linq expression for 'Where' when using multiple source tables
- LINQ Source Code Available
- linq - how do you do a query for items in one query source that are not in another one?
- Determine the source DataContext for a Linq to Sql query
- creating Linq to sqlite dbml from DbLinq source code
- Stubbing Code for Test With Linq Expressions and Lambdas
- Dynamic "Not" by parameter in LINQ (Or any other code for that matter)
- Understanding the various options for runtime code generation in C# (Roslyn, CodeDom, Linq Expressions, ...?)
- Using LINQ query result for data source for GridControl c#
- How can I refactor this code for LINQ filtering?
- Code Rewite for tuple and if else statements by using LINQ
- C# code for equivalent LINQ query
- Cannot build the Test project for LINQ IQueryable Toolkit (IQToolkit) - Code 9009
- How to assign multiple LINQ Include() statements to a variable for code re-use?
- How to get PEX to automatically generate inputs for code involving LINQ
- Open source LINQ search engine for website
- Can I use a LINQ IEnumerable result as the data source for a Gtk.TreeView?
- My code is very inefficient for this simple Linq usage
- replace 3 levels of nested for loops by efficient code possibly linq
- Why the extension method of where for LINQ in this code would print out a single number while it shouldn't print anything at all?
- LINQ entity data model generated code error - The type 'DBContexts.Category' already contains a definition for 'ID'
- Is it possible to have one LINQ in one line of code for
- how to write LINQ to objects equivalent code for this code
- Reduce the line of code for this LINQ query
- Linq extension method equivalent for that code in VB.NET
- Can I Use The Same Linq Code to Query for Different Conditions?
More Query from same tag
- Acces data from objects in a list
- Read distinct values from CSV to Datagridview in C#
- Finding an element with XDocument returning zero results
- How to do SQL Like % in Linq?
- GroupBy OrderBy Linq - invalid column
- get most frequently used values with linq
- How can i search partial part of a field using a list in LINQ?
- Extracting detail records of XML via C# LINQ
- Need to create Expression<Action> from strings
- Remove similar entries from a list
- Get a list within a list using Linq
- Getting values from a many-many relationship using unassociated data (LINQ)
- Is it possible to group a collection when each item could have more than one key?
- C# dynamic table creation : display table data in aspx page using linq query in a wcf service
- List<String[]> - Need suggestion as how to pull record from String[]
- Can't remove all elements that share same attribute value in XML
- If and else statement with linq
- save image order after drag and drop into database mvc
- Entity Framework deep select
- How do I use the AsQueryable method asynchronously with MongoDb C# Driver 2.1?
- Typecast each object in an array on a single line of code, using LINQ
- Select items from list using many ids
- not show anything in use from the class in entity framework
- Entity Framework complex multiple where condition
- Check if the item in the List is incremental and not redundant
- How to convert a list of dictionaries into IDictionary “C#”
- C# - Copy rows from one DataTable by comparing with 2nd DataTable to 3rd DataTable
- LINQ search filter logic
- Sort entity list based on entity property
- Slow AsQueryable() and universal method for IQueryable and IEnumerable