Reputation: 13501
I am developing with silverlight, and RIA services. I have a POCO object defined on the server side like this,
public class AssessmentRoad
{
[Key]
public int Id { get; set; }
[Required]
public int RoadLength { get; set; }
public int RoadId { get; set; }
[Required]
public string RoadName { get; set; }
[Required]
public string Suburb { get; set; }
public bool HasModified { get; set; }
}
The field HasModified is calculated and used on the client side only.
RIA services when I call SaveChanges decides that the entities need saving because the HasModified field has changed.
Is there an attribute I can use to make sure this doesn't happen? Or do I need to use a partial class etc?
On second thoughts perhaps the HasModified field shouldn't be there at all, and this should be wrapped up in a ViewModel instead?
Upvotes: 0
Views: 67
Reputation: 234
Add this property to a client-side partial class. See http://msdn.microsoft.com/en-us/library/ee707331(v=VS.91).aspx.
Upvotes: 1