is it possible inject static property, like I do below, because it does not work for me?
public static IMerchantModule MerchantModule { get; set; }
public RequestBaseValidationRules()
{
MerchantModule = ObjectFactory.GetInstance<IMerchantModule>();
}
It works when I inject to non static property.
Any tip welcome. Thanks, X.
Update: MerchantModule is null when it is accessed, see the example below
public static IBusinessRule<T> Sha1HashChecksum
{
get
{
return new BusinessRule<T>(
MethodBase.GetCurrentMethod().Name, "Sha1Hash is not valid",
request =>
{
string sharedSecret =
MerchantModule.GetSharedSecretForMerchantId(request.MerchantId);
string hashCheck = HashHelper.GetSha1Hash(request.StringToHash, sharedSecret);
return request.Sha1Hash.Equals(hashCheck);
});
}
}