1. Create new Entity:
Order newOrder = new Order();
EntityState property equals "Added"
2. Save via WCF service:
serviceClient.Save(newOrder);
3. On service side EntityState property equals "Unchanged"
.netTiers v2.3.0.RTM
CodeSmith 5.1.1 Release 8242
I suppose it's because there is no [DataMember] attribute on EntityState
property in the files:
EntityBaseCore.generated.cs, EntityInstanceBase.generated.cs
Putting this attribute, as in the code below, fixed this bug:
[BrowsableAttribute(false)<%= (!SerializeEntityState ? ",
XmlIgnoreAttribute()" : "") %>]
<% if (IncludeWCFDataAttributes && SerializeEntityState ) { %>
[DataMember]
<% } %>
public abstract EntityState EntityState { get; set; }
P.S. And some strange code I've found in the EntityBaseCore.generated.cs:
public virtual bool IsNew
{
get { return this.EntityState == EntityState.Added; }
set { this.EntityState = EntityState.Added; }
}
I don't know if this bug or not.
Original issue reported on code.google.com by ElS...@gmail.com on 17 Jun 2009 at 4:03
Original issue reported on code.google.com by
ElS...@gmail.com
on 17 Jun 2009 at 4:03