tags:

views:

84

answers:

0

Hello,

I have this configuration in my GeneralRegistry:

ForRequestedType<IClientBonusHistoryLoadTask>().AlwaysUnique().TheDefaultIsConcreteType<ClientBonusHistoryLoadTask>();

And I have this code:

public ClientAdvantagesUpdateTask(IBaseRepo<Client> repository, INHUnitOfWorkProvider uowProvider, IClientBonusHistoryLoadTask clientBonusHistoryLoadTask, ClientBonusHistoryLoadTask masterClientBonusHistoryLoadTask) : base(repository, uowProvider)
    {
      _clientBonusHistoryLoadTask = clientBonusHistoryLoadTask;
      _masterClientBonusHistoryLoadTask =
masterClientBonusHistoryLoadTask;

      bool y = clientBonusHistoryLoadTask.Equals
(masterClientBonusHistoryLoadTask);

      var task = ObjectFactory.GetInstance<IClientBonusHistoryLoadTask>
();
      var task2 =
ObjectFactory.GetInstance<IClientBonusHistoryLoadTask>();

      bool x = task.Equals(task2);
    }

For some reason, y is true (which is the problem) and x is false (which works as expected). Is this a bug, or am I doing something wrong?

Thanks.

Andrei