forked from ThatRendle/Simple.Data
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCastTask.cs
More file actions
31 lines (27 loc) · 811 Bytes
/
CastTask.cs
File metadata and controls
31 lines (27 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using Simple.Data;
namespace ProfilingApp
{
public class CastTask : IProfileTask
{
private readonly dynamic _db = Database.OpenConnection(Properties.Settings.Default.ConnectionString);
public void Run()
{
var watch = Stopwatch.StartNew();
List<Post> posts = _db.Posts.All().ToList<Post>();
Console.WriteLine(posts.Count);
watch.Stop();
Console.WriteLine(watch.Elapsed);
}
}
public class Post
{
public int ID { get; set; }
public string Title { get; set; }
public string Content { get; set; }
public DateTime Created { get; set; }
}
}