Format:
Recent snippets matching tags of injection
public static class UnityContainerExtensions { public static void AssertMappingsAreValid(this IUnityContainer container) { foreach (var registration in container.Registrations) { container.Resolve(registration.RegisteredType, registration.Name); } } }
92 Views
no comments
/* * 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 */
97 Views
no comments
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)
328 Views
1 comments
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
namespace Entity { public interface IBase { string Name { get; } } [Export("Base2", typeof(IBase))] [PartCreationPolicy(CreationPolicy.NonShared)] public class Base2 : IBase
368 Views
no comments
//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;
314 Views
no comments
public class OrderProcessor : IOrderProcessor { public OrderProcessor(IOrderValidator orderValidator, IOrderShipper orderShipper) { _orderValidator = orderValidator; _orderShipper = orderShipper; } public void Process(Order order) {
165 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
