Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

How to return a list to view after foreach in c#

// Replace DocInfo with the correct type name of the db.docinfo model
var res = new List<DocInfo>();

foreach (var i in find)
{
    var entities = db.docinfo.Where(z => z.RequestID == i.BookingID).ToList();
    res.AddRange(entities);
}

return View(res);
Comment

PREVIOUS NEXT
Code Example
Csharp :: unity set dictionary value 
Csharp :: VSIX Project Context Menu 
Csharp :: asp.net session empty cehck 
Csharp :: how to refresh the data table in C# window form datagridview 
Csharp :: if exist request c# 
Csharp :: c# how to disable a event 
Csharp :: asp net mvc convert ienumerable to selectlistitem 
Csharp :: tune off exit button wpf 
Csharp :: C# program to find sum of array elements 
Csharp :: pyqt send message to another instance 
Csharp :: add RowDefinition from cs xamarin 
Csharp :: Razor break/continue in loop 
Csharp :: datareader get field names 
Csharp :: c# Showing a hidden WPF window 
Csharp :: get appsetting.json config .net 
Csharp :: GridViewColumn url wpf 
Csharp :: IEqualityComparer gethashcode strings c# 
Csharp :: c# linq query map to entity 
Csharp :: unity phone vibration 
Csharp :: salary, overtime, deductions, gross pay and netpay in console C# 
Csharp :: Display all members of class using a for loop vb.net 
Csharp :: collection to datatable c# 
Csharp :: Process.Start(osk.exe) 
Csharp :: c# convert timestamp to datetime 
Csharp :: C# signup code 
Csharp :: quine in c# 
Csharp :: unity exenerate 
Csharp :: Showing a hidden WPF window 
Csharp :: .net 6 minimal api authorization net 6 
Csharp :: linq contains null 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =