wcf 서비스로 모델을 보내려고합니다. 먼저 내가 직렬화 문제가 있었다하지만 난Entity Framework 4.0 모델이 모든 데이터를 가져 오지 않습니다.
ContextOptions.ProxyCreationEnabled = false;
참조 자 DataContractSerializer Error using Entity Framework 4.0 with WCF 4.0 하지만 지금은 모델 속성 세금 및 제품을 설정하여 그것을 해결에
public ClientWindowViewModel()
{
Ip = ServerWindowViewModel.LocalIP;
db = new STOREDBEntities();
db.Configuration.ProxyCreationEnabled = false;
products = db.Products;//.Where(p => p.IsSynced == false)
}
제품 모델
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; }
}
보내기 null의 WCF 서버
channel.Update(checkedProducts);
예. 내가 대답을 찾을 위의 그것을 :) –