public class NotificationService: INotificationService{
private ILogService _logService;
public NotificationService(ILogService logService){
_logService = logService;
}
}
public class LogService: ILogService{
private INotificationService _notificationService;
public LogService(INotificationService notificationService){
_notificationService = notificationService;
}
}
I came into a situation where two classes depends on each other. I am using Ninject.
Bind<INotificationService>().To<NotificationService>();
Bind<ILogService>().To<LogService>();
The codes above are causing Cyclic Dependency. What is the proper way to solve this? Please share some codes.