Skip to content

Instantly share code, notes, and snippets.

public class FuncServiceLocator
{
Dictionary<Tuple<Type, string>, List<Func<object>>> _registry;
public void Register(Func<object> factory, Type type, string contract = null)
{
var pair = Tuple.Create(type, contract ?? "");
if (!_registry.ContainsKey(pair)) _registry[pair] = new List<Func<object>>();
_registry[pair].Add(factory);
using System;
using System.Linq.Expressions;
using System.Reflection;
using WebApi.Delta;
namespace Hst.Deals.API.Infrastructure
{
internal class CompiledPropertyAccessor<TEntityType> : PropertyAccessor<TEntityType> where TEntityType : class
{
private Action<TEntityType, object> _setter;
using System;
using System.Collections.Specialized;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.Configuration;
using System.Web.Hosting;
using System.Web.Security;
using System.Web.SessionState;