Smarter DTO with Unity IoC container

I have a MVVM model, where my view-model contains an observableCollection<RfidData>. Whenever data in this is updated, I would like to call RaisePropertyChanged() on the properties. I saw somewhere it could be done quite cleverly with the Unity IoC

Dependency Injection - Transfer Parameters to Constructed Types

I'm introducing Dependency Injection to my project. I've got a dialog window, which serves as an editor to either new or existing entity. Its ViewModel looks like the following: public class ContractWindowViewModel { private IRepository<Contract> co

UnityPerRequestHttpModule for WebApi?

Is there any equivalent to the: Microsoft.Web.Infrastructure.DynamicModuleHelper.DynamicModuleUtility.RegisterModule(typeof(UnityPerRequestHttpModule)); Found in the Unity Mvc Bootstrap but for the WebApi Boostrap?Yep, Unity.WebAPI nuget package + re

Unity Container Resolve

I just starting with Unity Container and my registration looks like this: static void UnityRegister() { _container = new UnityContainer(); _container.RegisterType<IBook, Book>(); _container.RegisterType<IBookRepository, BookRepository>("B

Unity IoC does not inject dependency into Web API Controller

I'm very new to using Unity, but my problem is that whenever I call my web service, I get an exception stating that "Make sure that the controller has a parameterless public constructor" I've followed multiple tutorials and I still get the same

prism ConfigureContainer what for

I m reading Prism library by microsoft. I just dont understand ConfigureContainer(). The code in shell application like this: internal class JamSoftBootstrapper : UnityBootstrapper { protected override IModuleEnumerator GetModuleEnumerator() { return

Web Api and Unity IoC

I would like to be able to register 2 class for the same interface in my Unity container. Then, I would like to select the current implementation based on a parameter. Here is my interface: public interface ICheckService { HttpResponseMessage Validat

Viewinjection with the failure of the unit

I have trouble getting navigation working using Prism 4. I've set up a test solution in which I have a shell with a region called MainRegion: <Window x:Class="PrismNavigationTest.ShellView" xmlns="http://schemas.microsoft.com/winfx/2006/

Repository Template with IoC - how should it be used correctly?

I am a lone developer and Pluralsight is my salvation in helping me understand things like Repository and IoC, which I am just learning. However I am finding the pattern awkward to use. So I am using Unity IoC, and following ModelContainer class; pub

UnityContainer.Resolve or ServiceLocator.GetInstance?

It could seem a stupid question because in my code everything is working, but I've registered a singleton this way with my Unity container _ambientContainer: _ambientContainer.RegisterType<Application.StateContext>(new ContainerControlledLifetimeMan

DDD / DI (Unity) / .NET / Root Composition - Domain Services

I have a standard Order/OrderLineItem setup. A number of Refunds are generated during the day that are persisted during the day, the Refund consists of a an Order Id and 1 or more LineItemId's. I need to consolidate these (in a Windows Service) at th

ASP.NET pages not removed from memory

I've been having really bad memory problems with an ASP.NET Application. It seems as if every time the page loads, the old previous instance of the page is not removed from memory. If you press F5 ten times, the memory adds 10-20MB to the instance. D

Circular reference with my bootloader / unit

Can anyone help. I have a serious problem with my Unity and bootloader. Its a circular reference.. Let me explain what i have currently. MainApp (winforms) ServiceLayer - c# project DependencyInjection - c# Project for the Container Bootloader - c# p

How to fill the collection with Unity

I have two example classes class ClassToResolve { private List<CollectionItem> _coll; public ClassToResolve(List<CollectionItem> coll) { _coll = coll; } } class CollectionItem { //... } and I need to resolve ClassToResolve var classToResolve =

ControllerFactory for a specific portable area

My main ASP.NET MVC composite application uses a global Unity container to register types. The app sets the controller factory up to use this global container. I would like to refactor this such that each one of my portable areas leverages it's own c

how to solve an IoC thorough circular reference?

Possible Duplicate: Can dependency injection prevent a circular dependency? I am developing a framework which will have various services like dal, integration with sharepoint, exception handling etc. I need to do it in IoC and I am new to this approa

MVC 3 beta + Dependency Resolver + Unity = problem obtained

I'm tried to use Dependency Resolver with Unity, and got some problem when my Controller creating. Here example of controller: public class AccountController : Controller { private readonly ICourseService _courseService; public AccountController(ICou

Unit: what and when to register

My current implementation of some ASP.NET web application registers all repository classes and some helper service classes in my wrapper around unity container: public class MyUnityContainer : UnityContainer { public MyUnityContainer () { string strC

Unity Dependency Injection for WCF Services

Can someone direct me to a good example of Unity Dependency Injection for WCF services? Any blog or msdn article will also help.This answer gives an example on how to enable DI in WCF with Castle Windsor. Just replace the IWindsorContainer with an IU

UNITY: Transmit a new data context each time?

I am trying to use unity to automatically inject a datacontext on my repository using a new instance each time.., my idea is the ensure that each time a new datacontext is injected Currently its failing on creating the repository, i think it can't re