title: WPF, WCF, Entity, MVVM doubts!
body: <p>I am using a WCF service reference in a WPF project, and my entity framework data model resides in WCF project.</p>
  
  <p>And I am using MVVM Light framework. I am doing the following things:</p>
  
  <ol>
  <li>I use LINQ in the service to get data and then fetch it from WPF,  obersvablecollections usually.</li>
  <li>Everything works in view part like populating datagrid, views as required.</li>
  </ol>
  
  <p>But I have following doubts:</p>
  
  <ol>
  <li>Is this  correct way of transferring data between wcf and wpf.</li>
  <li>I haven't used the Model for anything yet, I have doubt about when to use it?</li>
  <li>I also wanted to save data from datagrid. I was able to pass on the observablecollection of updated data of datagrid to the service's function. But how do i update the entity from this collection? by looping? doesnt sound right. Once I update the entity from this collection I will be able to use saveChanges to update into database.</li>
  <li>When I need to show hierarchal data in a treeview, where to make that data hierarichal, from stored procedure xml? use a view to create a grouping criteria column? create this column in service? create this column/property in presentation?</li>
  </ol>