Coder Social home page Coder Social logo

westerncivilization / docs-samples Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cy-org/docs-samples

0.0 1.0 0.0 55.27 MB

C# 39.77% PowerShell 0.01% Shell 0.01% Visual Basic 34.56% F# 0.35% C++ 12.79% CSS 0.13% ASP 10.95% HTML 0.20% JavaScript 0.42% Batchfile 0.03% XSLT 0.12% Makefile 0.38% C 0.13% 1C Enterprise 0.01% Smalltalk 0.14% Roff 0.01% Ada 0.01% HLSL 0.01% Lex 0.01%

docs-samples's Introduction

.NET Core Samples

This folder contains all the sample code that is part of any topic under the .NET Core documentation. There are several different projects that are organized in sub-folders. These sub-folders are organized similar to the organization of the docs for .NET Core.

Some of the articles will have more than one sample associated with them.

The readme.md file for each sample will refer to the article so that you can read more about the concepts covered in each sample.

Building a sample

You build the samples using the .NET Core CLI. You can download the CLI from the .NET Core home page. Then, execute these commands from the CLI in the directory of any sample:

dotnet build
dotnet run

These will install any needed dependencies, build the project, and run the project respectively.

Multi-project samples have instructions in their root directory in a README.md file.

Except where noted, all samples build from the command line on any platform supported by .NET Core. There are a few samples that are specific to Visual Studio and require Visual Studio 2017 or later. In addition, some samples show platform specific features and will require a specific platform.

Creating new samples

If you wish to add a code sample:

  1. Your sample must be part of a buildable project
  2. Your sample cannot be a Visual Studio Project
    • We do not want Windows and Visual Studio to be a dependency for people building these on their own. The only exception is if your sample highlights particular tooling and is referenced by a topic that explains the prerequisites.
  3. Your sample should conform to the corefx coding style to maintain consistency.
    • Additionally, we prefer the use of static methods rather than instance methods when demonstrating something that doesn't require instantiating a new object.
  4. If your sample builds a standalone package, you must include the runtimes used by our CI build system, in addition to any runtimes used by your sample:
    • win7-x64
    • win8-x64
    • win81-x64
    • ubuntu.16.04-x64

We will have a CI system in place to build these projects shortly.

To create a sample:

  1. File an issue or add a comment to an existing one that you are working on it.
  2. Write the topic that explains the concepts demonstrated in your sample (example: docs/standard/linq/where-clause.md)
  3. Write your sample (example: WhereClause-Sample1.cs)
  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:
  public class Program
  {
      public void Main(string[] args)
      {
          WhereClause1.QuerySyntaxExample();

          // Add the method syntax as an example.
          WhereClause1.MethodSyntaxExample();
      }
  }

To build and run your sample...

  1. Go to the sample folder and Build to check for errors.
   dotnet build
  1. Run!
   dotnet run
  1. Add a readme.md to the root directory of your sample.
    • This should include a brief description of the code, and refer people to the article that references the sample.

docs-samples's People

Contributors

jsntcy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.