using System.Collections.Generic;
public class AlertService
private readonly IAlertDAO _alertDaoService;
public AlertService(IAlertDAO alertDaoService){
if(!(alertDaoService is AlertDAO))
throw new Exception("Wrong object type");
_alertDaoService = alertDaoService;
return _alertDaoService.AddAlert(DateTime.Now);
public DateTime GetAlertTime(Guid id)
return _alertDaoService.GetAlert(id);
public class AlertDAO : IAlertDAO
private readonly Dictionary<Guid, DateTime> alerts = new Dictionary<Guid, DateTime>();
public Guid AddAlert(DateTime time)
Guid id = Guid.NewGuid();
this.alerts.Add(id, time);
public DateTime GetAlert(Guid id)
public static void Main()
Console.WriteLine("Hello World");
public interface IAlertDAO{
Guid AddAlert(DateTime time);
DateTime GetAlert(Guid id);