Skip to content

Instantly share code, notes, and snippets.

public class WebApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
RouteTable.Routes.MapRoute("HttpProxy", "proxy/{*path}", new { controller = "Proxy", action = "Http" })
}
}
@fzhenmei
fzhenmei / OracleDynamicParameters.cs
Last active August 29, 2015 14:02 — forked from vijayganeshpk/OracleDynamicParameters.cs
使用这个类替代 DynamicParameters 以解决 Dapper 调用 Oracle 存储过程不能处理返回游标的问题。
using Dapper;
using Oracle.ManagedDataAccess.Client;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
public class OracleDynamicParameters : Dapper.SqlMapper.IDynamicParameters {
private static Dictionary<SqlMapper.Identity, Action<IDbCommand, object>> paramReaderCache = new Dictionary<SqlMapper.Identity, Action<IDbCommand, object>>( );
@fzhenmei
fzhenmei / SqlDbType2DbType.cs
Created April 26, 2017 02:21 — forked from tecmaverick/SqlDbType2DbType.cs
Convert .Net Type to SqlDbType or DbType and vise versa
//Convert .Net Type to SqlDbType or DbType and vise versa
//This class can be useful when you make conversion between types .The class supports conversion between .Net Type , SqlDbType and DbType .
using System;
using System.Collections;
using System.Data;
namespace Devintelligence.Common.Data
{
/// <summary>
@fzhenmei
fzhenmei / SqlTableCreator.cs
Created September 4, 2017 06:29 — forked from riyadparvez/SqlTableCreator.cs
Create Sql table based on given DataTable schema
// Copyright (c) 2012-2013, Riyad Parvez
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
@fzhenmei
fzhenmei / NaiveBayes.cs
Created November 3, 2017 08:59 — forked from hodzanassredin/NaiveBayes.cs
simple naive bayes classifier in c#
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
//original https://github.com/bazhenov/naive-bayes-example
namespace NaiveBayesianClasisifier
{

C#编码规范

概述

规范制定原则

  • 方便代码的交流和维护。
  • 不影响编码的效率,不与大众习惯冲突。
  • 使代码更美观、阅读更方便。
  • 使代码的逻辑更清晰、更易于理解。