By Microsoft standards, Data Access Objects(DAO)...and Business Objects(BO) should return generic forms like IList instead of List.
But I need an 开发者_StackOverflow社区ObservableCollection in Viewmodel and there is no IObservableCollection .
What should I do in this case ?
Can I return IList from BO to viewmodel and convert IList to ObservableCollection ?
What are your collections of?
Let's say your service layer returns an IEnumerable<Customer>
. Your root view model should have a property that's an ObservableCollection<CustomerViewModel>
. So you're definitely going to need to have some code in your viewmodel to do this transformation, and at the same time you can populate an ObservableCollection instead of an IList or IEnumerable.
精彩评论