Skip to content

Instantly share code, notes, and snippets.

View SkightTeam's full-sized avatar

Hao Wang SkightTeam

View GitHub Profile

Creating Neat .NET Core Command Line Apps

You can now read this on my (pretty) website! Check it out here.

Every reason to get more HackerPoints™ is a good one, so today we're going to write a neat command line app in .NET Core! The Common library has a really cool package Microsoft.Extensions.CommandlineUtils to help us parse command line arguments and structure our app, but sadly it's undocumented.

No more! In this guide, we'll explore the package and write a really neat

@SkightTeam
SkightTeam / FizzBuzzWhizz
Created May 14, 2014 20:32
我的解决方案:Solution for ThoughtWorks的代码题 https://www.jinshuju.net/f/EGQL3D
using System;
using System.Collections.Generic;
using System.Text;
using Machine.Specifications;
using NUnit.Framework;
namespace Skight.HelpCenter.Domain.Specs
{
/// <summary>
/// Solution for ThoughtWorks的代码题 https://www.jinshuju.net/f/EGQL3D
@SkightTeam
SkightTeam / gist:2287483
Created April 2, 2012 21:50
Test --> Operate Data
using NHibernate;
using NHibernate.Context;
using NUnit.Framework;
using Skight.Demo.Domain;
using Skight.Demo.Domain.Examination;
namespace Skight.Demo.NHRepository.Tests
{
[TestFixture]
public class DataOperation
@SkightTeam
SkightTeam / gist:2287479
Created April 2, 2012 21:49
Test --> Create Database
using NUnit.Framework;
namespace Skight.Demo.NHRepository.Tests
{
[TestFixture]
public class CreateDatabase
{
[Test]
public void Run()
{
@SkightTeam
SkightTeam / gist:2287472
Created April 2, 2012 21:48
Persistent --> Query by nHibernate QueryOver
using NHibernate.Criterion;
using Skight.Demo.Domain;
namespace Skight.Demo.NHRepository.QueryImpls
{
public class QueryImplByQueryOver<item>:Query<item>
{
public QueryImplByQueryOver(QueryOver<item> query)
{
Query = query;
@SkightTeam
SkightTeam / gist:2287468
Created April 2, 2012 21:47
Persistent --> 考试类映射
using FluentNHibernate.Mapping;
using Skight.Demo.Domain.Examination;
namespace Skight.Demo.NHRepository
{
public class ExamMap:ClassMap<Exam>
{
public ExamMap()
{
Id(x => x.Id);
@SkightTeam
SkightTeam / gist:2287458
Created April 2, 2012 21:45
Persistent --> NHibibernate Session Provider
using System;
using System.IO;
using System.Reflection;
using FluentNHibernate.Cfg;
using FluentNHibernate.Cfg.Db;
using NHibernate;
using NHibernate.Cfg;
using NHibernate.Tool.hbm2ddl;
namespace Skight.Demo.NHRepository
@SkightTeam
SkightTeam / gist:2287452
Created April 2, 2012 21:43
Persistent --> NHibernate Repository Implementation
using System;
using System.Collections.Generic;
using System.Linq;
using NHibernate;
using NHibernate.Criterion;
using Skight.Demo.Domain;
using Skight.Demo.NHRepository.QueryImpls;
namespace Skight.Demo.NHRepository
{
@SkightTeam
SkightTeam / gist:2287433
Created April 2, 2012 21:41
Domain --> Query
namespace Skight.Demo.Domain
{
public interface Query<Item>
{
}
}
@SkightTeam
SkightTeam / gist:2287427
Created April 2, 2012 21:40
Domain --> Repository
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
namespace Skight.Demo.Domain
{
public interface Repository
{
Item get_by_id<Item>(int id);