I have a struct that I created specific for a usercontrol. My thought was that I would have a public property Guid Dictionary<string, Guid> Attachments
and then convert that to my private List<Attachment> attachments
on the setter. I'm having trouble doing that, preferably with linq but I'm open to alternatives. Thank you...
private List<Attachment> attachments;
public struct Attachment
{
public Guid Id { get; set; }
public string Name { get; set; }
}
public Dictionary<string, Guid> Attachments
{
get { return attachments.ToDictionary(a => a.Name, a => a.Id); }
set { attachments = new List<Attachment> // not sure what to do here }
}