Do you mean that you want to use attachments in more places in your model? For example for Employee
and for Customer
objects? Do you mean something like:
public class Attachment { /* Various properties... */ }
public class Attachments : List<Attachment>
{
public void DoSomething()
{
foreach (Attachment attachment in this)
DoSomethingToAttachment(attachment);
}
}
public interface IAttachmentHandler
{
void HandleAttachments();
}
public class Employee : IAttachmentHandler
{
private Attachments _attachments;
public void HandleAttachments()
{
_attachments.DoSomething();
}
}
public class Customer : IAttachmentHandler
{
private Attachments _attachments;
public void HandleAttachments()
{
_attachments.DoSomething();
}
}