I will present a stright forward step by step tutorial to build a complete Silverlight Business Application and how to merge the Membership provider database with our application database.
- Create your SQL Server db (example: dbExample).
- Run aspnet_regsql.exe found in: (C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regsql.exe)
- Choose your SQL Server instance and your database (dbExample) and go.
- Check new tables add to your database (dbExample) by asnet_regsql.
- Run MSVS2010 > New Project > Silverlight Business Application.
- Add to Web Applicataiono ADO.net EDM.
- Connect to your database (dbExample).
- Choose your tables.
- Open file Web.Config in Web Application
- Copy ConnectionString for your database (dbExample) for the EDM and paste it in the ConnectionString named ApplicationService.
- Choose Web Application and Run ASP.NET Confiugration
- Test connection
- Add Roles (example: Admin).
- Add User (example: viewUser).
- Add User (example: AdminUser) member of Admin Role.
- Add DomainService to Web Application, choose your tables, name it (exampleDomainService).
- In your DomainService (exampleDomainService) before each IQuerable query add the following:
- nothing query can be accessed by any user.
- [RequiresAuthentication] query can be accessed by logged in users only.
- [RequiresRole("Admin")] query can be accessed by logged in users and member of Role: (Admin).
- In Client Application in (Views) folder add (Silverlight Page), name it examplePage.xaml.
No comments:
Post a Comment