Created
April 18, 2017 17:07
-
-
Save bleroy/231846fad6a2850cf8d731eb4064be28 to your computer and use it in GitHub Desktop.
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
public class POCO | |
{ | |
public int Answer { get; set; } | |
} | |
//... | |
var db = DbContext.CreateDbContext(connectionString: | |
"Data Source=.\\SQL;Initial Catalog=tempdb;Integrated Security=True;Pooling=true;Max Pool Size=3000;"); | |
var ids = await db.QueryAsync("select [Answer] = object_id from sys.objects;"); | |
var pocoArray = ids.ToObjectArray<POCO>(); | |
foreach (var poco in pocoArray) | |
{ | |
Console.WriteLine(poco.Answer); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment