This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestFixture, Explicit] | |
public class ReflectingAnonymousTypes | |
{ | |
[Test] | |
public void DoesItWork() | |
{ | |
StudentVisa student = Build.AStudentVisa(); | |
var props = new {FirstName = "Keith", NationalityISO = "arj"}; | |
SetProperties(student,props); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#See http://msdn.microsoft.com/en-us/library/cc281962.aspx | |
PowerShell -NoExit -Command "$HOME\Documents\WindowsPowerShell\InitializeSQLProvider.ps1" | |
cd SQLSERVER:\sql\`(local`)\SQLSERVER2008\Databases\AdventureWorks2008\Tables | |
$opts = New-Object Microsoft.SqlServer.Management.Smo.ScriptingOptions | |
$opts.ScriptDrops = $true | |
$tables = ls | where {$_.Schema -eq "Production"} | |
$tables | foreach {$_.ForeignKeys} | foreach {$_.Script()} >> C:\Temp\CreateKeysScript.sql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var lines = new[] | |
{ | |
"Line1", "Line2", "Line3" | |
}; | |
var query = lines.Select((line, index) => new | |
{ | |
Prop = string.Format("Address{0}", index + 1), | |
Value = line | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void ImportFiles() | |
{ | |
var query = from f in files | |
where f.Extension.ToLower() == ".zip" | |
select new ImportContext | |
{ | |
ZipFileName = f.FullName, | |
Path = UploadPath | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type="text/javascript" language="JavaScript"> | |
function addCommas(nStr) | |
{ | |
nStr += ''; | |
x = nStr.split('.'); | |
x1 = x[0]; | |
x2 = x.length > 1 ? '.' + x[1] : ''; | |
var rgx = /(\d+)(\d{3})/; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static IEnumerable<PropertyValue> GetProperties(object o) | |
{ | |
if (o != null) { | |
var props = TypeDescriptor.GetProperties(o); | |
foreach (PropertyDescriptor prop in props) { | |
var val = prop.GetValue(o); | |
if (val != null) { | |
yield return new PropertyValue { Name = prop.Name, Value = val }; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ld/ | |
*.suo | |
*.user | |
bin | |
Bin | |
obj | |
_ReSharper* | |
*.csproj.user | |
*.resharper.user | |
*.suo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using WebFormsAndSRP.CookieManagement; | |
namespace WebFormsAndSRP | |
{ | |
public partial class Default : System.Web.UI.Page | |
{ | |
private IMarketingTracker _marketingTracker; | |
protected void Page_Load(object sender, EventArgs e) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT TOP 5 description, hit_count |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT u.[region 1], s.full_name AS RegionalManager | |
FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0', 'Data Source=c:\managers.xls;Extended Properties=Excel 8.0')...Updates$ | |
JOIN staff s | |
on s.id = u.staff_id |
OlderNewer