I am trying to send the model to a wcf service. First i had a serialization problem but i solved it by setting
ContextOptions.ProxyCreationEnabled = false;
referrer DataContractSerializer Error using Entity Framework 4.0 with WCF 4.0 but now models Properties Tax and Products are null
public ClientWindowViewModel()
{
Ip = ServerWindowViewModel.LocalIP;
db = new STOREDBEntities();
db.Configuration.ProxyCreationEnabled = false;
products = db.Products;//.Where(p => p.IsSynced == false)
}
Product Model
public partial class Product
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public Product()
{
this.Categories = new HashSet<Category>();
}
public int Id { get; set; }
public string ProductName { get; set; }
public byte[] Image { get; set; }
public bool IsDeleted { get; set; }
public bool IsSynced { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection<Category> Categories { get; set; }
public virtual Tax Tax { get; set; }
}
Send To WCF Server
channel.Update(checkedProducts);