protected override void Load(ContainerBuilder builder) { builder.Register(ctx => { IUserPersistence persistence = ctx.Resolve <IUserPersistence>(); IMapper mapper = ctx.Resolve <IMapper>(); return(new UserDomain(persistence, mapper)); }).As <IUserDomain>().InstancePerLifetimeScope(); }
public UserDomain(IUserPersistence persistence, IMapper mapper) { _persistence = persistence; _mapper = mapper; }
public UserController(IUserPersistence userPersistence) { _userPersistence = userPersistence; }