/src/SampleLibrary/IOC/SampleFactoryWithConstructorArguments.cs
http://github.com/philiplaureano/LinFu · C# · 26 lines · 21 code · 5 blank · 0 comment · 2 complexity · 60df036951024cc7846dafc833e490af MD5 · raw file
- using System;
- using LinFu.IoC.Configuration;
- using LinFu.IoC.Interfaces;
- namespace SampleLibrary.IOC
- {
- [Factory(typeof(string), ServiceName = "SampleFactoryWithConstructorArguments")]
- public class SampleFactoryWithConstructorArguments : IFactory
- {
- public ISampleService _sample;
- public SampleFactoryWithConstructorArguments(ISampleService service)
- {
- if (service == null)
- throw new ArgumentNullException("service");
- _sample = service;
- }
- public object CreateInstance(IFactoryRequest request)
- {
- return "42";
- }
- }
- }