CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of T4
<#
//       Created by Dan Wahlin - http://www.thewahlingroup.com
//     Title: T4 Metadata and Data Annotations template
//       Usage: Generates the initial "buddy" classes to handle data validation across multiple frameworks
//       Description: I got tired of writing my initial "buddy" classes by hand once my EF model was created. This template
//                    handles generating all the classes and generates the primitive and navigation properties. It also
//                    decorates the properties with the [Required] and [StringLength] attributes as appropriate. Once the
//                    template generates the code you can copy it to a new file and make all the tweaks you want to support
//                    custom data annotations.
//       License: UIFAYW - Use it for anything you want (free or commercial)
by Dan Wahlin   February 20, 2011 @ 9:27am
1384 Views
no comments
 
C#
using System;
using System.Dynamic;
using System.Linq.Expressions;
 
namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
by Spartaco Giubbolini   December 17, 2010 @ 10:54am
Tags: NET4
109 Views
no comments
 
XML
<?xml version="1.0"?>
<configuration>
 
  <system.web>
    <compilation debug="false" targetFramework="4.0" />
  </system.web>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>
  <system.serviceModel>
by tonyv   September 18, 2010 @ 11:06pm
Tags: JsonP, WCF, .NET4
552 Views
no comments
 
<#@ assembly name="$(SolutionDir)lib\dotless.Core.dll" #>
by Viktar   August 09, 2010 @ 2:43pm
195 Views
no comments
 
C#
/// <summary>
/// Holds up the test execution for the given duration without blocking the UI thread.
/// </summary>
void UIPause(int sec)
{
    Storyboard PauseSB = new Storyboard() { Duration = new Duration(new TimeSpan(0, 0, sec)) };
    PauseSB.Completed += (sender, e) => { TestComplete(); };
    PauseSB.Begin();
}
454 Views
no comments
 
C#
public static IEnumerable<TSource> Distinct<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> selector)
{
    return source.Distinct(new SelectorEqualityComparer<TSource, TKey>(selector));
}
by Paulo Morgado   April 10, 2010 @ 5:22am
251 Views
no comments
 
C#
public static IEnumerable<TSource> Distinct<TSource>(this IEnumerable<TSource> source, Func<TSource, TSource, bool> predicate)
{
    return source.Distinct(new PredicateEqualityComparer<TSource>(predicate));
}
by Paulo Morgado   April 10, 2010 @ 5:21am
289 Views
no comments
 
C#
[Serializable]
public class SelectorEqualityComparer<TSource, Tkey> : EqualityComparer<TSource>
{
    private Func<TSource, Tkey> selector;
 
    public SelectorEqualityComparer(Func<TSource, Tkey> selector)
        : base()
    {
        this.selector = selector;
    }
by Paulo Morgado   April 10, 2010 @ 5:18am
Tags: C#, .NET, .NET35, .NET40
300 Views
no comments
 
C#
[Serializable]
public class PredicateEqualityComparer<T> : EqualityComparer<T>
{
    private Func<T, T, bool> predicate;
 
    public PredicateEqualityComparer(Func<T, T, bool> predicate)
        : base()
    {
        this.predicate = predicate;
    }
by Paulo Morgado   April 10, 2010 @ 5:12am
Tags: C#, .NET, .NET35, .NET40
258 Views
no comments
 
C#
<#@ template language="C#v3.5" hostspecific="True" debug="True" #> 
<#@ output extension="cs" #>
<#@ assembly name="Microsoft.SqlServer.ConnectionInfo" #>
<#@ assembly name="Microsoft.SqlServer.SqlEnum" #>
<#@ assembly name="Microsoft.SqlServer.Smo" #>
<#@ assembly name="System.Data" #>
<#@ assembly name="System.Core.dll" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="Microsoft.SqlServer.Management.Smo" #>
<#@ import namespace="Microsoft.SqlServer.Management.Common" #>
by Rob   March 19, 2010 @ 12:44pm
400 Views
no comments
 
C#
<#@ template language="C#v3.5" hostspecific="True" debug="True" #> 
<#@ output extension="cs" #>
<#@ assembly name="Microsoft.SqlServer.ConnectionInfo" #>
<#@ assembly name="Microsoft.SqlServer.Smo" #>
<#@ assembly name="System.Data" #>
<#@ import namespace="Microsoft.SqlServer.Management.Smo" #>
<#@ import namespace="Microsoft.SqlServer.Management.Common" #>
<#@ import namespace="System.Data.SqlClient" #>
<#@ import namespace="System.Collections.Specialized" #>
<#
by Rob   March 04, 2010 @ 7:47am
Tags: T4, Sql, c#
1126 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate