Skip to content

Instantly share code, notes, and snippets.

@vegar
vegar / Program.cs
Last active May 10, 2017 12:29
LightInject issue #359
using System;
using System.Linq;
using ConsoleApplication3.LightInject;
namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
{
2013-04-25 09:41:42,323 [3] DEBUG NHibernate.Impl.SessionImpl - [session-id=de5e5dbb-d393-4e1f-a509-69f00c61066b] opened session at timestamp: 635024797023, for session factory: [/f356b6e2e842431db71726e28be22db7]
2013-04-25 09:41:42,324 [3] DEBUG NHibernate.Linq - Expression (partially evaluated): value(NHibernate.Linq.NhQueryable`1[DIPS.IDMConnector.Entities.User]).Where(u => (u.UserName == "PASIENT")).FirstOrDefault()
2013-04-25 09:41:42,324 [3] DEBUG NHibernate.Engine.Query.QueryPlanCache - located HQL query plan in cache (.FirstOrDefault[DIPS.IDMConnector.Entities.User](.Where[DIPS.IDMConnector.Entities.User](NHibernate.Linq.NhQueryable`1[DIPS.IDMConnector.Entities.User], Quote((u, ) => (String.op_Equality(u.UserName, p1))), ), ))
2013-04-25 09:41:42,324 [3] DEBUG NHibernate.Engine.Query.QueryPlanCache - located HQL query plan in cache (.FirstOrDefault[DIPS.IDMConnector.Entities.User](.Where[DIPS.IDMConnector.Entities.User](NHibernate.Linq.NhQueryable`1[DIPS.IDMConnector.Entities.User], Quote((u, ) => (S
@vegar
vegar / gist:5204165
Created March 20, 2013 12:07
db.ExecuteProcedure( ) fails for oracle
using System.Data;
using System.Data.OracleClient;
using ServiceStack.OrmLite;
using ServiceStack.OrmLite.Oracle;
namespace OrmLite.Oracle.Procedure
{
class Program
{
public class Test
@vegar
vegar / gist:1044691
Created June 24, 2011 12:38
SelectAndGiveFocusToFirstElementInListBoxBehaviour - example code for StackOverflow question 6467928
public class SelectAndGiveFocusToFirstElementInListBoxBehavior
{
public static readonly DependencyProperty EnabledProperty =
DependencyProperty.RegisterAttached(
"Enabled",
typeof(bool),
typeof(SelectAndGiveFocusToFirstElementInListBoxBehavior),
new FrameworkPropertyMetadata(0, new PropertyChangedCallback(OnEnabledChanged)));
public static bool GetEnabled(ListBox listBox) {...}
@vegar
vegar / gist:fa4e35b557ed37150d43
Created June 20, 2014 11:41
Playing with LightInject Constructor Injection
using LightInject;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace UnitTestProject1
{
[TestClass]
public class UnitTest1
{
public interface IMyService