I have this class:
public class Lockbox
{
string lockbox { get; set; }
int polling_interval { get; set; }
}
In another class I made a List of Type Lockbox:
var monitor_lockboxes = new List<Lockbox>();
Now how do I add entries to the list? Can I do this?:
monitor_lockboxes.Add(...);
But it does not take 2 arguments.
Well no, it wouldn’t. It takes one argument, of type
Lockbox.It sounds like you want something like:
You can do it in a single statement, of course – I’ve only separated it out here for clarity.
(I’d also strongly advise you to change your naming to follow .NET conventions.)