Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

mvc list to jsonresult

[HttpPost]
public JsonResult GetAreasForCompany(int companyId)
{
  var areas = context.Areas
    .Where(x => x.Company.CompanyId == companyId)
    .Select(a => new
    {
      AreaId = a.AreaId,
      Title = a.Title
    });
  return Json(areas);
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: C# .NET Core linq Distinct 
Csharp :: how to pause physics in unity c# 
Csharp :: unity controls 3d 
Csharp :: c# average of 3 numbers 
Csharp :: how to execute linux command from c# 
Csharp :: invert string c# 
Csharp :: unity rotate towards 
Csharp :: c# open url 
Csharp :: c# date 
Csharp :: how to make an object invisible unity 
Csharp :: c# file dialog to get folder path 
Csharp :: c# initialize empty list 
Csharp :: unity check if a animator parameter trigger is activated 
Csharp :: c# how to refreshyour bindingsource 
Csharp :: replace elements with greatest element on right side 
Csharp :: Unity c#loading a scene after a few seconds 
Csharp :: unity normalize float 
Csharp :: how to deselect a button through code unity 
Csharp :: .net Core Get File Request 
Csharp :: enum element count C# 
Csharp :: how to make a mouse down condition in unity 
Csharp :: how to check a list is null or empty in c# 
Csharp :: unity how to get the side ways velocity of a object 
Csharp :: C# Program For Check Total Occurrence Of A Number In An Array 
Csharp :: c# initialize empty array 
Csharp :: serilog minimum log level 
Csharp :: c# String.Concat() 
Csharp :: rotate player unity 
Csharp :: C# calculate sum of digits of a number 
Csharp :: how add text to element in javascript 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =