Last post Feb 07, 2013 02:55 AM by chandradev1
Feb 04, 2013 09:53 PM|avt2k7|LINK
Anyone knows how to write a WCF service that insert data into database using repository pattern, LINQ to Entity Framework, please help me soon.
I can do it in ADO.NET but I am new with above technology. Your time to help me with sample code are much appreciated. I searched online but I am not sure how to start???
I did the following steps:
1. Created a WCF Service Application that take XML string to parse them into XML element values as following:
I parsed above XML into three parameters: paramNAME = Robert, paramGRADE = 9 and paramDATE = 1-20-2013. Now I would like to insert element values into SchoolRecord table with columns (id, Name, Grade, Date) where id is unique key which generated from system.
2. I am not sure how to organize the project structure for DAL(data access layer), Entities, Business Logic and how to using Repository pattern for LINQ to Entity Framework. Please help me to get start. Thanks in advance.
Feb 05, 2013 10:38 PM|Haixia Xie - MSFT|LINK
If you want to insert data to database using wcf, you need several steps, create a database table, create a WCF service that include a method used to insert data(before this, get each field from the xml), create a application as cleint to test. For details
you can refer to this blog.
#Insert Data Into SQL Server Database Using WCF Service
Hope this can help you.
Feb 06, 2013 04:47 PM|avt2k7|LINK
Thank for your inputs. Your link to insert data into database using ADO.NET not the one that I am looking for. I like to update new technology using LINQ to Entity Framework, repository pattern.
Feb 07, 2013 02:55 AM|chandradev1|LINK
I hope you are knowing the basic concept of WCF. You can get sysntax for Insert/Update/Delete with Database using EF from this post
You can use same sysntax in your WCF Service.