Meinen Sie, dass Sie Anhänge an mehreren Stellen in Ihrem Modell verwenden möchten? Zum Beispiel für Employee
und für Customer
Objekte? Meinst du etwas wie:
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();
}
}
Ich nehme an, du meinst die Schienen fungiert als Anlage Art der Anlage? Vielleicht möchten Sie Ihre Frage so bearbeiten, dass sie speziell den Dateianhang widerspiegelt, wenn Sie das vorhaben? –