WCF/WF - upload data using ORM and WCF Service

Asked By gkv nadh on 15-Feb-13 01:19 AM

 My Requirement is  Upload data from Client db to Server db. using ORM and WCF Service.

i created File--new--ConsoleApp(better is classlibrary) but testing purpose i taken ConsoleApp. then Added--ADO.net Entity Model--

I prepared service as a generic:


   public class Service1:IService1



  public void Add(TEntity entity)


    VHOP_OdhisaEntities context = new VHOP_OdhisaEntities();           // Server ORM

    ObjectSet<TEntity> _Objectset = context.CreateObjectSet<TEntity>();






at client i succefully add the service reference:

 at client :

                vhopodhisaEntities ClientEntities = new vhopodhisaEntities();  // Client ORM


     Service1Client proxy = new Service1Client();    

// Now I am trying to add single entity/table/Advices data to server db.



     List<TEntity> dt = ClientEntities.Advices.ToList<TEntity>();  // Advices table/Entity 


    IEnumerator<TEntity> data =dt.GetEnumerator();

     while (data.MoveNext())


    TEntity entites  =data.Current;   // here entities is ConsoleApplication1.TEntity                        



proxy.Add(ServiceReference1.TEntity)-----how to solve this issue.

ERROR : Cannot convert ServiceReference1.TEntity to
VhopodhisaEntities.TEntity. // Client ORM

Here I am sending one table ==> which Advices table 

but my requirement is send all the tables.  how to send all the tables data. to server. please tell me a soluation ...urgently require soluation