Skip to content

Commit fcc431d

Browse files
committed
Merge pull request #98 from BethMassi/master
Update samples readme.md
2 parents c18fbc8 + 66f5ea0 commit fcc431d

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed

samples/README.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,51 @@ If you wish to add a code sample:
99

1010
- We do not want Windows and Visual Studio to be a dependency for people building these on their own.
1111

12-
We will eventually have a CI system in place to build these projects.
12+
We will eventually have a CI system in place to build these projects.
13+
14+
To create a sample:
15+
16+
1. File an [issue](https://github.com/dotnet/core-docs/issues) or add a comment to an existing one that your working on it
17+
2. For each set of samples that demonstrate a concept, add a project.json with your dependencies and target coreclr:
18+
19+
```
20+
{
21+
"dependencies": {
22+
"System.Runtime":"4.0.0-rc1-*",
23+
"System.Linq":"4.0.0-rc1-*",
24+
"System.Console": "4.0.0-rc1-*"
25+
},
26+
"frameworks": {
27+
"dnxcore50":{}
28+
}
29+
}
30+
```
31+
32+
3. Write your sample. ex. WhereClause-Sample1.cs
33+
4. Create a program.cs with a Main entry point that calls your samples. If there is already one there, add the call to your sample:
34+
35+
```
36+
public class Program
37+
{
38+
public void Main(string[] args)
39+
{
40+
var sample = new WhereClause1();
41+
sample.QuerySyntaxExample();
42+
sample.MethodSyntaxExample();
43+
}
44+
}
45+
```
46+
To to build and run your sample...
47+
48+
5. Grab the latest coreclr:
49+
```
50+
dnvm upgrade latest -r coreclr -u
51+
```
52+
6. Go to the sample forlder and Build to check for errors.
53+
```
54+
dnu build
55+
```
56+
7. Run!
57+
```
58+
dnx run
59+
```

0 commit comments

Comments
 (0)