This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main() | |
{ | |
var json = @" | |
[ | |
{ | |
'Id': 10, | |
'Lines': [ | |
{ | |
'Id': 20, | |
'Packages': [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main() | |
{ | |
var context = new BlogContext(); | |
var query = from post in context.Posts | |
let likes = from like in context.Likes | |
where like.PostId == post.Id | |
select like | |
select new | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Recursive traversing of a nodes collection | |
void Main() | |
{ | |
var nodes = new[] | |
{ | |
new Node{Id = 1, ParentId = null, Title = "Root"}, | |
new Node{Id = 2, ParentId = 1, Title = "Two"}, | |
new Node{Id = 3, ParentId = 1, Title = "Three"}, | |
new Node{Id = 4, ParentId = 3, Title = "Four"}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//SELECT FK_ClassId, LectureDays | |
//FROM tbl_TimeTables | |
//WHERE(FK_ClassId = 11) | |
//group by fk_classid, lecturedays | |
//having count(distinct Period) < 7 | |
void Main() | |
{ | |
var context = new TimeContext(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main() | |
{ | |
var first = new [] | |
{ | |
new MyType{Id = 11, Name = "John"}, | |
new MyType{Id = 12, Name = "Jack"}, | |
new MyType{Id = 13, Name = "Jim"}, | |
new MyType{Id = 14, Name = "Joel"}, | |
new MyType{Id = 15, Name = "Jay"}, | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main() | |
{ | |
var json = @"{ | |
'prop1': 'bla', | |
'propn': 'bla', | |
'Data': { | |
'42': { | |
'prop1': 'bla', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// <category name=".NET" xmlns="urn:test" xmlns:xs="http://www.w3.org/2001/XMLSchema"> | |
// <books> | |
// <book>CLR via C#</book> | |
// <book>Essential .NET</book> | |
// </books> | |
// </category> | |
void Main() | |
{ | |
var xml = @" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//select * | |
//from directors d | |
//inner join managers m | |
// on d.id = m.director | |
//inner join employees e | |
// on m.id = e.manager | |
//where e.name = 'John' | |
public static void Main() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Round 1 Melbourne City -Brisbane Roar 2 - 0 | |
//Round 1 Central Coast-Newcastle Jest 1 - 5 | |
//Round 2 Melbourne City -Brisbane Roar 2 - 0 | |
void Main() | |
{ | |
var matches = new[] | |
{ | |
new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//select | |
// Supplier.Name, | |
// Supplier.Adress, | |
// Supplier.Email, | |
// Supplier.Phone, | |
// Supplier.Supplier_Zipcode | |
//from | |
// item, | |
// Supp_Company, | |
// Supplier |