Created
January 22, 2012 05:47
-
-
Save msbukkuri/1655808 to your computer and use it in GitHub Desktop.
SystemMonitoring Objects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Alert | |
{ | |
public String Id { get; set; } | |
public int Priority { get; set; } | |
public String Message { get; set; } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Client | |
{ | |
public string Id { get; set; } | |
public string Name { get; set; } | |
public List<Alert> Alerts { get; set; } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ClientRepository : IRepository | |
{ | |
private readonly IList<Client> _clientList = new List<Client>(); | |
public ClientRepository() | |
{ | |
_clientList.Add(new Client() | |
{ | |
Alerts = new List<Alert>() | |
{ | |
new Alert() | |
{ | |
Id = Guid.NewGuid().ToString(), | |
Message = "This is Alert1", | |
Priority = 1 | |
}, | |
new Alert() | |
{ | |
Id = Guid.NewGuid().ToString(), | |
Message = "This is Alert2", | |
Priority = 2 | |
}, | |
new Alert() | |
{ | |
Id = Guid.NewGuid().ToString(), | |
Message = "This is Alert3", | |
Priority = 3 | |
} | |
}, | |
Id = Guid.NewGuid().ToString(), | |
Name = "7-11" | |
}); | |
_clientList.Add(new Client() | |
{ | |
Alerts = new List<Alert>() | |
{ | |
new Alert() | |
{ | |
Id = Guid.NewGuid().ToString(), | |
Message = "This is Alert1", | |
Priority = 1 | |
}, | |
new Alert() | |
{ | |
Id = Guid.NewGuid().ToString(), | |
Message = "This is Alert2", | |
Priority = 2 | |
}, | |
new Alert() | |
{ | |
Id = Guid.NewGuid().ToString(), | |
Message = "This is Alert3", | |
Priority = 3 | |
} | |
}, | |
Id = Guid.NewGuid().ToString(), | |
Name = "Barnes & Noble" | |
}); | |
_clientList.Add(new Client() | |
{ | |
Alerts = new List<Alert>() | |
{ | |
new Alert() | |
{ | |
Id = Guid.NewGuid().ToString(), | |
Message = "This is Alert1", | |
Priority = 1 | |
}, | |
new Alert() | |
{ | |
Id = Guid.NewGuid().ToString(), | |
Message = "This is Alert2", | |
Priority = 2 | |
}, | |
new Alert() | |
{ | |
Id = Guid.NewGuid().ToString(), | |
Message = "This is Alert3", | |
Priority = 3 | |
} | |
}, | |
Id = Guid.NewGuid().ToString(), | |
Name = "Steinmart" | |
}); | |
} | |
public IEnumerable<Client> GetAll() | |
{ | |
return _clientList; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment