Domain Service WCF Interview Questions and Answers Part 16

1. What is the Domain Service?
Ans. Domain services are WCF services that expose the business logic of a WCF RIA Services application. 

2. What is the base class for Domain Service?
Ans. The DomainService class is the base class for all classes that serve as domain services.

3. What is the hosting classs for Domain Service?
Ans. Internally DomainServiceHost is the hosting class for domain service.

4. Which class DomainServiceHost uses to host the application?
Ans. DomainServiceHost uses the WCF ServiceHost class to host the application.

5. Which attribute is used to enable client project to consume Domain Service?
Ans. A domain service class uses the "EnableClientAccess" attribute to make the service available to the client project. 

Example:

Example:
    [EnableClientAccess()]
    public class StudentDomainService : DomainService
    {
        private StudentData data = StudentData.Instance;
 
        public IEnumerable <Student> GetStudents()
        {
            return data.StudentList;
        }
    }

6. Which class is used to consume Domain Service at client project?
Ans. DomainContext class at the client side is used to consume the Domain service by using DomainClient object.

7. What is the namespace for DomainContext?
Ans. DomainContext class available inside the name space "System.ServiceModel.DomainServices.Client"

8. What is the other way to mark "EnableClientAccess" in Domain Service?
Ans. EnableClientAccess attribute is automatically applied to a domain service when you select 
the Enable client access check box in the Add New Domain Service Class dialog box.

9. Which object is used in Domain Service to handle large data?
Ans. Large amount of data can be accessed and filtered using IQueryable object.

10. How to implement Security or Access control in Domain Service?
Ans. ASP.Net membership frameworks are integrated with RIA service to provide security systems to RIA service.
 






Subscribe

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

Delivered by FeedBurner

Protected by Copyscape Duplicate Content Checker