locked
WCF using EF 4.1 RRS feed

  • Question

  • Hello,

           I want to know certains fundamentals about using wcf in conjuction with EF 4.1

     

    1) When I use wcf with EF 4.1 , Object/(s) which I am gonna receive via wcf service is still object persistance?

    2) If above ans is yes then can I use IsDirty and other object property on my client side which is either asp.net mvc / wpf type.

    3) If answer to q.1 is no then what alternative I have to design to achive this object persistance?

     

    Regards,

    Nilkanth Desai

     

    Friday, April 8, 2011 5:19 AM

Answers

  • On 4/8/2011 1:19 AM, Nilkanth wrote:
    > Hello,
    >
    > I want to know certains fundamentals about using wcf in conjuction with
    > EF 4.1
    >
    > 1) When I use wcf with EF 4.1 , Object/(s) which I am gonna receive via
    > wcf service is still object persistence?
     
    The persistence of an object is to save the object's data to a data
    stor, such as a database, which is done through a DAL Data Access Layer
    the WCF service would be using.
    >
    > 2) If above ans is yes then can I use IsDirty and other object property
    > on my client side which is either asp.net mvc / wpf type.
     
    The Business object in the domain or a Data Transfer object in the
    domain  keep their state with IsDirty, IsNew, IsMarkedDelete properties
    in the object. Data mapping is done between the  EF entity and the BO or
    DTO to retrieve or persist objects the EF objects to the database
    >
    > 3) If answer to q.1 is no then what alternative I have to design to
    > achive this object persistance?
    >
     
    The state of the BO or DTO will tell you what path to take when
    persisting the EF object to the data stor.
     
    1) If is IsDirty = object is to saved.
    2) If IsNew = object is to be inserted into the database.
    3) If !IsNew = object is to be updated in the database.
    4) If IsMarkedDelete = object is to be deleted from the database
     
     
    • Marked as answer by Nilkanth Monday, April 11, 2011 11:52 AM
    Saturday, April 9, 2011 5:40 PM