WCF Interview Questions and Answers Part 9

1. Will TryUpdateModel accessible in wcf service library?

Ans. No, TryUdateModel is not accessible outside mvc project.
                     
          if (TryUpdateModel(RecordFound))
         {
           Cntxt.SaveChanges();
         }



2. How to implement editing entity in wcf service library which access database using entity framework?

Ans. To edit an entity using entity framework in wcf, the following code works well.
 Cntxt.Entry(TargetItem).State = EntityState.Modified;
  Cntxt.SaveChanges();  
                     

3. How to view markup section of wcf service file?
Ans. Simply right click on ".svc" file and select "view markup".

4. In the following element, what is the meaning of address=""?
<endpoint address="" binding="wsHttpBinding" contract="CSample.IContract">
<identity>
 <dns value="localhost"/>
 </identity>
</endpoint>

Ans. Here address="" means it will refer localhost.


5. In vs2013, SvcConfigEditor is replaced with which name?
Ans. On vs2013 SvcConfigEditor is renamed with "Edit WCF configuration".
Steps:
In WCF project --> right click on "webconfig" file --> Edit WCF config

 






Subscribe

Receive Quality Tutorials Straight in your Inbox by submitting your Email below:

Delivered by FeedBurner

Protected by Copyscape Duplicate Content Checker