Saturday, 15 September 2012

c# - How to add an inherited type using wcf data service client -



c# - How to add an inherited type using wcf data service client -

i have inheritance hierarchy owners, tenants, vendors , agents derived people. in wcf info service client, want utilize addobject create new owner, cannot find how this. when try:

var owner = new owner() { firstname = "test" ,lastname = "person" ,checkname = "test person" ,personno = "test" ,usefullnameforname = false ,typeofperson = "owner" }; //add context.addobject("people", owner); context.savechanges();

the service throws dynamic sql error. using wcf services 5.4 ef 4.5.

you should create entity type of table.

var person = new person { firstname = "test" ,lastname = "person" ,checkname = "test person" ,personno = "test" ,usefullnameforname = false ,typeofperson = "owner" }; context.persons.addobject(person); context.savechanges();

c# wcf-data-services

No comments:

Post a Comment