C# Tutorial: LINQ

preview_player
Показать описание
In this lesson I go over LINQ and how to use it.
Рекомендации по теме
Комментарии
Автор

Taught more in 7 mins than my lecturer in an hour.

Ben-bnld
Автор

thank you so much. Finishing my diploma with this

fauzizee
Автор

using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleApp1
{
internal class Program
{
static void Main(string[] args)
{
var myBooks = new List<Book>()
{
new Book() {Title = "C#", Price = 9.4},
new Book() {Title = "C++", Price = 5.4},
};

var books = from book in myBooks
where book.Title == "C#"
select book;
books.ToList().ForEach(book => { });

}
}
class Book
{
public string Title { get; set; }
public double Price { get; set; }
}

}

kvelez
Автор

It would have been better if you could have spent some more time on this and explained it in a little more detail.

rjaditya
Автор

using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleApp1
{
internal class Program
{
static void Main(string[] args)
{
var myBooks = new List<Book>()
{
new Book() {Title = "C#", Price = 9.4},
new Book() {Title = "C++", Price = 5.4},
};

var books = from book in myBooks
orderby book.Price descending
select book;
books.ToList().ForEach(book => { });

}
}
class Book
{
public string Title { get; set; }
public double Price { get; set; }
}

}

kvelez