Skip to content

Instantly share code, notes, and snippets.

@vegar
vegar / Program.cs
Last active May 10, 2017
LightInject issue #359
View Program.cs
using System;
using System.Linq;
using ConsoleApplication3.LightInject;
namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
{
@vegar
vegar / gist:fa4e35b557ed37150d43
Created Jun 20, 2014
Playing with LightInject Constructor Injection
View gist:fa4e35b557ed37150d43
using LightInject;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace UnitTestProject1
{
[TestClass]
public class UnitTest1
{
public interface IMyService
View log
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 Mar 20, 2013
db.ExecuteProcedure( ) fails for oracle
View gist:5204165
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 Jun 24, 2011
SelectAndGiveFocusToFirstElementInListBoxBehaviour - example code for StackOverflow question 6467928
View gist:1044691
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) {...}
You can’t perform that action at this time.