This file contains 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
require 'simple_entity' | |
#Example Usage | |
obj = SimpleEntity.new("SELECT * FROM Payers WHERE PayerID = 'dg8gfb01-fgba-48ge-be5d-02d5dfg9hh7d'") | |
puts obj.PayerName + "\n\n" | |
puts obj.inspect #See all the columns |
This file contains 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
//Loading associations into ViewData | |
public ActionResult Edit(Guid id) | |
{ | |
var model = Repositories.Model.GetById(id); | |
ViewData["Association"] = model.Association; //Gah! Magic Strings | |
return View(model); | |
} | |
//In the view: | |
Html.Grid<AssociationType>( |
This file contains 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
<!--[if !IE]><!--> | |
<style type="text/css" media="screen, print"> | |
@font-face { | |
font-family: "My Custom Font"; | |
src: url("http://brendanjerwin.github.com/VeraMono.ttf"); | |
} | |
</style> | |
<!-- <![endif]--> | |
<!--[if IE]> |
This file contains 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 ISessionFactory ConfigureNHibernate(IPersistenceConfigurer databaseConfigurer, | |
out ValidatorEngine validatorEngine, | |
NHibernate.Cfg.Configuration cfg) | |
{ | |
ValidatorEngine ve = null; | |
var factory = Fluently.Configure(cfg) | |
.Database(databaseConfigurer) | |
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<PatientMap>()) | |
.ExposeConfiguration(c => | |
{ |
This file contains 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 FluentNHibernate.Cfg; | |
using FluentNHibernate.Cfg.Db; | |
using NHibernate; | |
using NHibernate.Validator.Cfg; | |
using NHibernate.Validator.Engine; | |
using StructureMap; | |
using StructureMap.Attributes; | |
namespace Models.Data.Util |
This file contains 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
[TestFixtureSetUp] | |
public void FixtureSetUp() | |
{ | |
Configuration cfg; | |
Models.Data.Util.Configuration.ConfigureDataAccess(SQLiteConfiguration.Standard.InMemory(), | |
InstanceScope.Singleton, out cfg); | |
session = ObjectFactory.GetInstance<ISession>(); | |
IDbConnection connection = session.Connection; |
This file contains 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; | |
namespace TestAnonymousGeneric | |
{ | |
internal class MyClass<T> | |
{ | |
public T val { get; set;} | |
public static MyClass<ET> Build<ET>(ET valValue) | |
{ |
This file contains 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; | |
namespace TestAnonymousGeneric | |
{ | |
internal static class MyClass | |
{ | |
public static MyClass<ET> Build<ET>(ET valValue) | |
{ | |
return new MyClass<ET> { val = valValue }; |
This file contains 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 System.Collections.Generic; | |
using System.Data.SqlClient; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using NHibernate.Dialect; | |
using NHibernate.Tool.hbm2ddl; | |
using StructureMap.Attributes; | |
This file contains 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; | |
namespace Machine.Specifications.Example | |
{ | |
[Subject(typeof(Account), "Funds transfer")] | |
public class when_transferring_between_two_accounts | |
: with_from_account_and_to_account | |
{ | |
Because of = () => | |
fromAccount.Transfer(1m, toAccount); |
OlderNewer