jeudi 10 décembre 2015

Array Property wrapper in C#

I have two read only Wrapper classes, I want W_Meeting[] property not to be a converted copy of Meeting objects to W_Meeting and exposed as W_Meeting[], but instead a way to yield the W_Meeting directly trough underlying MeetingResponse object that is wrapped. What should i put in place of missing code? Any design patterns applicable to this scenario?

public class W_MeetingResponse 
{
    private MeetingResponse _underlyingValue;

    public W_Meeting[] dates
    {
        get { //how to yeild without having to copy and convert the array }
    }
}


public class W_Meeting //Wrapper for Meeting
{
    private Meeting _underlyingValue;    
}

Aucun commentaire:

Enregistrer un commentaire