Skip to content

Instantly share code, notes, and snippets.

View natemcmaster's full-sized avatar

Nate McMaster natemcmaster

View GitHub Profile
handle SIGXCPU SIG33 SIG35 SIGPWR nostop noprint
define mono_backtrace
select-frame 0
set $i = 0
while ($i < $arg0)
set $foo = (char*) mono_pmip ($pc)
if ($foo)
printf "#%d %p in %s\n", $i, $pc, $foo
else
@natemcmaster
natemcmaster / coding.md
Last active August 29, 2015 14:25
Coding Guidelines

Entity Framework - Coding Guidelines

For contributors.

C# 6.0

We use C# 6.0 features to make our code more readable and refactor friendly.

[NotNull] and Check.NotNull()

Resharper code cleanup

Expected:
<link href="/test1.css" rel="stylesheet" />
<link href="/test2.css" rel="stylesheet" />
Actual:
<link href="/test1.css" rel="stylesheet" />
@natemcmaster
natemcmaster / packages.config
Last active August 29, 2015 14:26
Minimal packages needed for EF.SqlServer
<?xml version="1.0" encoding="UTF-8"?>
<packages>
<package id="EntityFramework.Core" version="7.0.0-beta6" targetFramework="net451" />
<package id="EntityFramework.Relational" version="7.0.0-beta6" targetFramework="net451" />
<package id="EntityFramework.SqlServer" version="7.0.0-beta6" targetFramework="net451" />
<package id="Ix-Async" version="1.2.4" targetFramework="net451" />
<package id="Microsoft.Framework.Caching.Abstractions" version="1.0.0-beta6" targetFramework="net451" />
<package id="Microsoft.Framework.Caching.Memory" version="1.0.0-beta6" targetFramework="net451" />
<package id="Microsoft.Framework.Configuration.Abstractions" version="1.0.0-beta6" targetFramework="net451" />
<package id="Microsoft.Framework.Configuration.Binder" version="1.0.0-beta6" targetFramework="net451" />
@natemcmaster
natemcmaster / runtime.json
Created October 7, 2015 16:42
From Microsoft.NETCore.Platforms.1.0.1-beta-23405
{
"runtimes": {
"base": {
},
"any": {
"#import": [ "base" ]
},
"win": {
@natemcmaster
natemcmaster / AWBuildVersion.cs
Last active October 23, 2015 22:39
AdventureWorks2014
using System;
using System.Collections.Generic;
namespace ConsoleApplication
{
public partial class AWBuildVersion
{
public byte SystemInformationID { get; set; }
public string Database_Version { get; set; }
public DateTime ModifiedDate { get; set; }
@natemcmaster
natemcmaster / AWBuildVersion.cs
Created October 23, 2015 22:41
AdventureWorks with attributes
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ConsoleApplication.av
{
public partial class AWBuildVersion
{
[Key]
@natemcmaster
natemcmaster / clear-dnx.cmd
Created October 26, 2015 22:51
Delete DNX packages
rmdir /S %LOCALAPPDATA%\dnu\cache\
rmdir /S %USERPROFILE%\.dnx\packages\

EF + Net Native

Limitations in Query

Query or projections with anonymous types

Queries that project or involve the use of anonymous types.

Examples
context.Posts.Select(g => new { u = g.Url, c = g.Count() });
@natemcmaster
natemcmaster / xunit
Created October 31, 2015 02:33
Xunit parameters
xUnit.net Console Runner (64-bit .NET 4.0.30319.17020)
Copyright (C) 2015 Outercurve Foundation.
usage: xunit.console <assemblyFile> [configFile] [assemblyFile [configFile]...] [options] [reporter] [resultFormat filename [...]]
Note: Configuration files must end in .json (for JSON) or .config (for XML)
Valid options:
-nologo : do not show the copyright message
-nocolor : do not output results with colors