What’s the best way to model business objects with complex properties?

I currently model my BOs simply by having private DTO member and exposing everyone property on that DTO by wraping, like so…

 public class Status : ViewModelBase { private DTO.Status status; public int ID { get { return status.ID; } set { status.ID = value; RaisePropertyChanged(); } } public string StatusCode { get { return status.StatusCode; } set { status.StatusCode = value; RaisePropertyChanged(); } } } 

but I recently come accross issue where I don't know what my BO should have for situations when there is foreign key. SHould I model the entire object or still expose the foreign key Id?

by Karmadilla via /r/csharp

Leave a Reply