Skip to content

Instantly share code, notes, and snippets.

View dandohotaru's full-sized avatar

Dan Dohotaru dandohotaru

  • Brussels, Belgium
View GitHub Profile
void Main()
{
var json = @"
[
{
'Id': 10,
'Lines': [
{
'Id': 20,
'Packages': [
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
{
// 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"},
//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();
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"},
};
void Main()
{
var json = @"{
'prop1': 'bla',
'propn': 'bla',
'Data': {
'42': {
'prop1': 'bla',
// <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 = @"
//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()
{
//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
//select
// Supplier.Name,
// Supplier.Adress,
// Supplier.Email,
// Supplier.Phone,
// Supplier.Supplier_Zipcode
//from
// item,
// Supp_Company,
// Supplier