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)
1384 Views
no comments
using System; using System.Dynamic; using System.Linq.Expressions; namespace ConsoleApplication1 { class Program { static void Main(string[] args) {
109 Views
no comments
<?xml version="1.0"?> <configuration> <system.web> <compilation debug="false" targetFramework="4.0" /> </system.web> <system.webServer> <modules runAllManagedModulesForAllRequests="true"/> </system.webServer> <system.serviceModel>
552 Views
no comments
<#@ assembly name="$(SolutionDir)lib\dotless.Core.dll" #>
195 Views
no comments
/// <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
public static IEnumerable<TSource> Distinct<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> selector) { return source.Distinct(new SelectorEqualityComparer<TSource, TKey>(selector)); }
251 Views
no comments
public static IEnumerable<TSource> Distinct<TSource>(this IEnumerable<TSource> source, Func<TSource, TSource, bool> predicate) { return source.Distinct(new PredicateEqualityComparer<TSource>(predicate)); }
289 Views
no comments
[Serializable] public class SelectorEqualityComparer<TSource, Tkey> : EqualityComparer<TSource> { private Func<TSource, Tkey> selector; public SelectorEqualityComparer(Func<TSource, Tkey> selector) : base() { this.selector = selector; }
300 Views
no comments
[Serializable] public class PredicateEqualityComparer<T> : EqualityComparer<T> { private Func<T, T, bool> predicate; public PredicateEqualityComparer(Func<T, T, bool> predicate) : base() { this.predicate = predicate; }
258 Views
no comments
<#@ 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" #>
400 Views
no comments
<#@ 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" #> <#
1126 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
