• Code
  • Tags
  • Users
  • Titles
  • Log in
  • Feedback
  • FAQ
Share Code
Welcome to ForkCan.com

ForkCan is all about sharing code in a social way.

Discuss, debate or argue with other devs about their or your own code.

Give other devs feedback or make a Fork (Make a better version of a shared code).

Rate the code, if you use the code mark it as used so others can see if the shared code is used by someone.

Help each other to be better devs and to be more productive.


Features not working yet:

Flag a post

Tagged code '.net' feeds
Latest activity

Tagged Code

Views Used Newest Oldest

791
Views
Extension to the HttpClient
By @fredrikn "I'm the master"  February 16, 2012 5:50 PM

"Extension method to simplify posting with HttpClient, also an sync extension method."
.net

Mark '.net' tag as 'like'

Mark '.net' tag as 'ignore'

aspmvc

Mark 'aspmvc' tag as 'like'

Mark 'aspmvc' tag as 'ignore'

c#

Mark 'c#' tag as 'like'

Mark 'c#' tag as 'ignore'

webapi

Mark 'webapi' tag as 'like'

Mark 'webapi' tag as 'ignore'

0 0 0 0


865
Views
Invoke Extension Method
By Mugi "Code Contributor"  December 01, 2010 12:16 PM

"Tired of all Invoke methods? Use this Invoke + Lambda"
.net

Mark '.net' tag as 'like'

Mark '.net' tag as 'ignore'

c#

Mark 'c#' tag as 'like'

Mark 'c#' tag as 'ignore'

extension-method

Mark 'extension-method' tag as 'like'

Mark 'extension-method' tag as 'ignore'

invoke

Mark 'invoke' tag as 'like'

Mark 'invoke' tag as 'ignore'

threading

Mark 'threading' tag as 'like'

Mark 'threading' tag as 'ignore'

1 1 0 1


851
Views
Reflection dynamically get private fields or properties
By @najklord   October 13, 2010 7:23 PM

"Use Reflection to dynamically get private fields or properties. The BindingFlags are important on private fields."
.net

Mark '.net' tag as 'like'

Mark '.net' tag as 'ignore'

c#

Mark 'c#' tag as 'like'

Mark 'c#' tag as 'ignore'

reflection

Mark 'reflection' tag as 'like'

Mark 'reflection' tag as 'ignore'

0 0 0 0


1.54k
Views
Generic linq-to-sql repository
By alexandern   September 29, 2010 10:59 PM

"A generic linq-to-sql class for easy, strongly-typed data access"
.net

Mark '.net' tag as 'like'

Mark '.net' tag as 'ignore'

c#

Mark 'c#' tag as 'like'

Mark 'c#' tag as 'ignore'

linq-to-sql

Mark 'linq-to-sql' tag as 'like'

Mark 'linq-to-sql' tag as 'ignore'

repository

Mark 'repository' tag as 'like'

Mark 'repository' tag as 'ignore'

0 0 1 3


1.22k
Views
Null Dot "Operator" Extension Method
By @jeffhandley   September 25, 2010 9:22 AM

"The _ extension method will return null if the object is null, or it will return the property/method value."
.net

Mark '.net' tag as 'like'

Mark '.net' tag as 'ignore'

c#

Mark 'c#' tag as 'like'

Mark 'c#' tag as 'ignore'

0 1 0 1


840
Views
Use of Extension methods to hide "infrastructure code"
By @fmork   September 17, 2010 12:03 AM

"Extension methods for the ReaderWriterLockSlim class, allowing you to write more compact code, hiding necessary repetetive code."
.net

Mark '.net' tag as 'like'

Mark '.net' tag as 'ignore'

c#

Mark 'c#' tag as 'like'

Mark 'c#' tag as 'ignore'

extension-method

Mark 'extension-method' tag as 'like'

Mark 'extension-method' tag as 'ignore'

0 1 0 2


668
Views
Method to hash passwords
By Jiggr "Code Contributor"  September 15, 2010 8:28 PM
.net

Mark '.net' tag as 'like'

Mark '.net' tag as 'ignore'

c#

Mark 'c#' tag as 'like'

Mark 'c#' tag as 'ignore'

hash

Mark 'hash' tag as 'like'

Mark 'hash' tag as 'ignore'

0 0 0 2


906
Views
Email validation with Regular Expression
By @fredrikn "I'm the master"  September 11, 2010 7:12 PM

"Validates if an e-mail is in a correct format"
.net

Mark '.net' tag as 'like'

Mark '.net' tag as 'ignore'

c#

Mark 'c#' tag as 'like'

Mark 'c#' tag as 'ignore'

regular-expression

Mark 'regular-expression' tag as 'like'

Mark 'regular-expression' tag as 'ignore'

0 0 0 4


837
Views
Url Validation with Regular Expression
By @fredrikn "I'm the master"  September 11, 2010 7:10 PM

"A helper method to validate if a URL is valid"
.net

Mark '.net' tag as 'like'

Mark '.net' tag as 'ignore'

c#

Mark 'c#' tag as 'like'

Mark 'c#' tag as 'ignore'

regular-expression

Mark 'regular-expression' tag as 'like'

Mark 'regular-expression' tag as 'ignore'

0 0 0 1


425
Views
Number of sealed / unsealed types in the framework
By Steven   September 03, 2010 9:26 AM

"A Console application to determine the number of sealed and unsealed types in the framework"
.net

Mark '.net' tag as 'like'

Mark '.net' tag as 'ignore'

c#

Mark 'c#' tag as 'like'

Mark 'c#' tag as 'ignore'

framework-design

Mark 'framework-design' tag as 'like'

Mark 'framework-design' tag as 'ignore'

sealed

Mark 'sealed' tag as 'like'

Mark 'sealed' tag as 'ignore'

0 0 0 0


1.4k
Views
Make sure the web.config pages/namespace can be used together with ASP.NET MVC 3 P1 and Razor
By @fredrikn "I'm the master"  August 04, 2010 11:18 AM

"Make sure namespaces will be imported into every view when using ASP.NET MVC 3.0 Preview 1"
.net

Mark '.net' tag as 'like'

Mark '.net' tag as 'ignore'

aspmvc

Mark 'aspmvc' tag as 'like'

Mark 'aspmvc' tag as 'ignore'

aspnet4

Mark 'aspnet4' tag as 'like'

Mark 'aspnet4' tag as 'ignore'

c#

Mark 'c#' tag as 'like'

Mark 'c#' tag as 'ignore'

razor

Mark 'razor' tag as 'like'

Mark 'razor' tag as 'ignore'

0 0 0 0


1.26k
Views
Unity Service Locator for ASP.NET MVC 3.0 Beta 1
By @fredrikn "I'm the master"  August 01, 2010 9:35 AM

"A Unity 2.0 Service Locator which can be used with ASP.Net MVC 3.0"
.net

Mark '.net' tag as 'like'

Mark '.net' tag as 'ignore'

aspmvc

Mark 'aspmvc' tag as 'like'

Mark 'aspmvc' tag as 'ignore'

c#

Mark 'c#' tag as 'like'

Mark 'c#' tag as 'ignore'

service-locator

Mark 'service-locator' tag as 'like'

Mark 'service-locator' tag as 'ignore'

0 1 0 0


1.77k
Views
UnitOfWork Action filter for ASP.NET MVC and nHibernate
By @fredrikn "I'm the master"  July 27, 2010 4:25 PM

"Reuse unit of work among several repositories by using the HTTPContext"
.net

Mark '.net' tag as 'like'

Mark '.net' tag as 'ignore'

aspmvc

Mark 'aspmvc' tag as 'like'

Mark 'aspmvc' tag as 'ignore'

c#

Mark 'c#' tag as 'like'

Mark 'c#' tag as 'ignore'

nhibernate

Mark 'nhibernate' tag as 'like'

Mark 'nhibernate' tag as 'ignore'

repository

Mark 'repository' tag as 'like'

Mark 'repository' tag as 'ignore'

0 0 0 3


1.77k
Views
A Default Entity Framework 4.0 ObjectContext Factory
By @fredrikn "I'm the master"  July 14, 2010 7:41 AM

"This is a default EF ObjectContext factory, perfect when using POCOs"
.net

Mark '.net' tag as 'like'

Mark '.net' tag as 'ignore'

c#

Mark 'c#' tag as 'like'

Mark 'c#' tag as 'ignore'

ef4.0

Mark 'ef4.0' tag as 'like'

Mark 'ef4.0' tag as 'ignore'

factory

Mark 'factory' tag as 'like'

Mark 'factory' tag as 'ignore'

objectcontext

Mark 'objectcontext' tag as 'like'

Mark 'objectcontext' tag as 'ignore'

0 0 0 0


1.3k
Views
Custom C# exception class
By @mliversage "Code Contributor"  July 12, 2010 11:18 PM

"Minimum code required to create a custom exception in C#"
.net

Mark '.net' tag as 'like'

Mark '.net' tag as 'ignore'

c#

Mark 'c#' tag as 'like'

Mark 'c#' tag as 'ignore'

exceptions

Mark 'exceptions' tag as 'like'

Mark 'exceptions' tag as 'ignore'

0 0 0 0

12

Squeed
Made by: Fredrik Normén 2010