//class MessageModel
public class MessageModel
{
public string Name{get;set;}
public BindingList<AttachDocument> _attachDocument {get;set;};
}
// class AttachDocument that it's object is a MessageModel property
public class AttachDocument
{
public string AttachName { get; set; }
public bool IsCheck { get; set; }
}
MessageModel source = new MessageModel { AttachDocument = new BindingList<AttachDocument>()};
MessageModel value = new MessageModel { AttachDocument = new BindingList<AttachDocument>()};
// Error "AttachName" is not defined
source.AttachDocument.AttachName = value.AttachDocument.AttachName; // What I want to access
So how can I access access object's property in inside other object's property and assign a value.