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
{ | |
"results": [ | |
{ | |
"lifetime": "transient", | |
"contract": "MediatR.ISender" | |
}, | |
{ | |
"lifetime": "transient", | |
"contract": "MediatR.IPublisher" | |
}, |
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
//+---------------------------------+ | |
//| Name PValue RValue NValue Group | | |
//+---------------------------------+ | |
//| Low 100 600 300 Car | | |
//| High 900 400 700 Car | | |
//| Low 200 300 500 Truck| | |
//| High 800 700 500 Truck| | |
//+---------------------------------+ | |
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
//<?xml version="1.0"?> | |
//<catalog> | |
// <book id="bk101"> | |
// <author>Gambardella, Matthew</author> | |
// <title>XML Developer's Guide</title> | |
// <genre>Computer</genre> | |
// <price>44.95</price> | |
// <publish_date>2000-10-01</publish_date> | |
// <description>An in-depth look at creating applications | |
// with XML.</description> |
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
//Product ## | |
//ProductId | |
//ProductName | |
//IsDeleted(bit) | |
// | |
//ProductTag | |
//ProductTagId | |
//ProductId | |
//TagName | |
//IsDeleted(bit) |
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 persons = new[] | |
{ | |
new Person{Id= 1, Name="John Doe", Age=21}, | |
new Person{Id= 2, Name="Jane Doe", Age=22}, | |
new Person{Id= 3, Name="Jim Doe", Age=23}, | |
}; | |
var map = new Func<Person, dynamic>(person => |
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 data = new[] | |
{ | |
new Asset{Id=1, Name="one"}, | |
new Asset{Id=2, Name="two"}, | |
new Asset{Id=3, Name="three"}, | |
new Asset{Id=4, Name="four"}, | |
new Asset{Id=5, Name="five"}, | |
new Asset{Id=6, Name="six"}, |
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 ctx = new DemoContext(); | |
var inner1 = ctx.Filter<Bar>(value: "Const1"); | |
var inner2 = ctx.Filter<Bar>(value: "Const2"); | |
var inner3 = ctx.Filter<Bar>(value: "Const3"); | |
var query = from foo in ctx.Foos | |
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
// Same as initial recursive attempt but playing around with graph creation | |
void Main() | |
{ | |
var trip = new | |
{ | |
Origin = "CMB", | |
Destination = "DEL", | |
}; |
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
// How could I map my area from a Tile[,] to a int[,], where only the height is saved? | |
void Main() | |
{ | |
var area = new Tile[7, 10]; | |
var rows = area.GetLength(0); | |
var columns = area.GetLength(1); | |
var random = new Random(); |
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
// Rely on http://xmltocsharp.azurewebsites.net/ for xml to C# mappings | |
void Main() | |
{ | |
var xml = @" | |
<SalesQuotes xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns='http://api.some.com/version/1'> | |
<Pagination> | |
<NumberOfItems>2380</NumberOfItems> | |
<PageSize>200</PageSize> | |
<PageNumber>1</PageNumber> | |
<NumberOfPages>12</NumberOfPages> |
NewerOlder