Skip to content

Instantly share code, notes, and snippets.

// boom
public class Ex
{
public static readonly Ex Foo = Parse('f');
public static readonly Ex Bar = Parse('b');
Dictionary<char, string> validValues = new Dictionary<char, string>
{
{ 'f', "Foo" },
{ 'b', "Bar" },
// example:
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
BindingErrors.Throw();
// app gubbins here
}
}
Fluent Mappings
---------------
Types discovered:
EmployeeMap | Examples.FirstProject.Mappings.EmployeeMap, Examples.FirstProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
LocationMap | Examples.FirstProject.Mappings.LocationMap, Examples.FirstProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
ProductMap | Examples.FirstProject.Mappings.ProductMap, Examples.FirstProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
StoreMap | Examples.FirstProject.Mappings.StoreMap, Examples.FirstProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
Is there any common name for all these types?
string
char
int
long
short
double
float
byte
MANY-TO-MANY
create table Left (
Id integer
Name TEXT
)
create table LeftRights (
LeftId INTEGER not null,
Key TEXT not null,
<map name="Units">
<key column="ProductId"/>
<index column="UnitName" type="string"/>
<many-to-many class="Unit" column="UnitId"/>
</map>
ValueTypeBuilder Map<TReturn>(Expression<Func<T, TReturn>> property)
where TReturn : ValueType
{
return new ValueTypeBuilder(property);
}
EntityBuilder Map<TReturn>(Expression<Func<T, TReturn>> property)
where TReturn : class
{
return new EntityBuilder(property);
interface ILine
{}
class AdditionLine : ILine {}
class SubtractionLine : ILine {}
class ModificationLine : ILine {}
void ProcessLines(IList<ILine> lines) {}
var additions = new List<AdditionLine>();
@jagregory
jagregory / Form1.cs
Created June 26, 2010 23:04
Why does the C# form create a window 700px wide, while the Ruby form opens with the default 300px?
public class Form1 : Form
{
public Form1()
{
Width = 700;
}
}
# my git clone workflow (on windows)
git clone _whatever_
git status
# if you get anything showing up as changed in your status output, you've got
# line endings issues. if status is clean, you're good to go, otherwise:
git config core.autocrlf false
git status