Skip to content

Instantly share code, notes, and snippets.

View kkozmic's full-sized avatar
🎯
Focusing

Krzysztof Kozmic kkozmic

🎯
Focusing
View GitHub Profile
namespace INPC.Using.Dynamic.Proxy
{
using System;
using System.ComponentModel;
using System.Reflection;
using Castle.Core.Interceptor;
using Castle.DynamicProxy;
class Program
{
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
namespace DP115Test
{
using System;
class Program
{
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
namespace DP115Test
{
using System;
class Program
{
Container = new WindsorContainer()
.AddFacility<WcfFacility>()
.Register(
Component.For<IServiceBehavior>()
.ImplementedBy<ServiceMetadataBehavior>()
.Parameters(Parameter.ForKey("HttpGetEnabled").Eq("true"))
.LifeStyle.Transient,
Component.For<IMyService>()
.Named("my service")
.ImplementedBy<TheService>()
//rather than this...
var ex = Assert.Throws<FooException>(()=>foo.DoFoo("bar"));
Assert.Contains("bar should be foo", ex.Message);
// ... I'd prefer this
Assert.Throws<FooException>(()=>foo.DoFoo("bar"),(ex)=>
Assert.Contains("bar should be foo", ex.Message));
using System;
using System.Linq;
namespace DP_perf_1
{
using System.Diagnostics;
using Castle.DynamicProxy;
class Program
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
namespace ConsoleApplication2
{
class Program
{
using System;
using System.Linq;
namespace DP_perf_1
{
using System.Data;
using System.Diagnostics;
using System.ServiceModel;
using System.Web;
using System.Windows;
using System;
using System.Diagnostics;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
public class TestClient
{
// no need for additional methods, properties, or delegates
// All internal state needs to be declared as protected proterties
protected virtual Address Address { get; set; }
// Domain behavior does not have to be virtual, nor return anything
public void ClientMoves(Address address)
{