CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of injection
C#
public static class UnityContainerExtensions
{
    public static void AssertMappingsAreValid(this IUnityContainer container)
    {            
        foreach (var registration in container.Registrations)
        {
            container.Resolve(registration.RegisteredType, registration.Name);
        }
    }
}
by Byteflux   October 04, 2011 @ 10:36pm
92 Views
no comments
 
C#
/* 
 * Escrito por Jone Polvora - jpolvora@gmail.com
 * Julho2011
 * Novidades: Convenção para resolver interfaces (IClasse, Classe)
 * Resolver por String
 * Resolver com parâmetros
 * Escopo de registro
 * Objetos registrados com WeakReference
 */
 
by Jone   August 01, 2011 @ 10:47pm
97 Views
no comments
 
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
 
public class SimpleContainer 
{
    readonly List<ContainerEntry> entries = new List<ContainerEntry>();
 
    public void RegisterInstance(Type service, string key, object implementation)
by Rob Eisenberg   July 25, 2010 @ 12:06pm
328 Views
1 comments
 
C#
private IEnumerable<MemberInfo> GetImportMembers(Type type)
        {
            var local = new HashSet<string>();
            if (type.IsAbstract)
            {
                yield break;
            }
 
            foreach (var member in GetDeclaredOnlyImportMembers(type))
            {
309 Views
no comments
 
C#
namespace Entity
{
public interface IBase
{
    string Name { get; }    
}
 
[Export("Base2", typeof(IBase))]
[PartCreationPolicy(CreationPolicy.NonShared)]
public class Base2 : IBase
by codding4fun   June 08, 2010 @ 1:55am
368 Views
no comments
 
C#
//this is the MEF Team Code
namespace System.ComponentModel.Composition.AttributedModel
{
    internal class AttributedPartCreationInfo : IReflectionPartCreationInfo
    {
private IEnumerable<MemberInfo> GetImportMembers(Type type)
{
    if (type.IsAbstract)
    {
        yield break;
by codding4fun   June 08, 2010 @ 1:32am
314 Views
no comments
 
C#
 
by codding4fun   June 08, 2010 @ 1:27am
239 Views
no comments
 
C#
public class OrderProcessor : IOrderProcessor
{
    public OrderProcessor(IOrderValidator orderValidator, IOrderShipper orderShipper)
    {
        _orderValidator = orderValidator;
        _orderShipper = orderShipper;
    }
    
    public void Process(Order order)
    {
by Andy Sherwood   February 04, 2010 @ 10:37am
165 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate