| |
browse.develop.com
Browse.develop.com is a community that was established to collect and
organize valuable web information. Our technical staff have selected and
indexed information and courses that they feel will help you stay
current on best practices across the SDLC.
|
1 Articles match "Attribute","Sample"
| Related DevelopMentor Courses | MORE | | Decouple WCF Services from their DI Container with Common Instance Factory Service ="CommonInstanceFactory.Sample.Services.GreetingService" %> When you want to change from one DI container to another, all you need to do is replace the Factory attribute with the ServiceHostFactory of the new container. To see examples of using CIF with WCF extensions, download samples and source code from the CIF CodePlex site. In my last blog post I introduced the Common Instance Factory , which I built as an alternative to Common Service Locator to reduce coupling between an application and a Dependency Injection (DI) container. Enjoy. Technical DI WCF DevelopMentor Courses - Saturday, May 26, 2012 |
32 Articles match "Attribute","Sample"
| The Latest from DevelopMentor | MORE | | Improve perceived performance of ASP.NET MVC websites with asynchronous partial views In the sample case, it’s kind of an iGoogle landing page with different items: TODO, news, etc. Notice how we use the data-url attribute to simplify coordinating the proper location for the content. Check out the live demo I’ve posted here: Sample: Improve Perceived Performance with Async Partial Views. Imagine you’re building an ASP.NET MVC website which has some performance problems. m sure this would never actually happen to you, but imagine you’re facing this problem just for the sake of exploring the possibilities. :-). First a disclaimer / warning. click to enlarge). Michael C. Kennedy's Weblog - Tuesday, November 13, 2012 Understanding Text Encoding in ASP.NET MVC (ASP.NET MVC Foundations Series) By default, if you have an action method taking this input, it will just error out with the following message: Error on submit: A potentially dangerous Request.Form value was detected from the client… Of course, we could disable this with a ValidateInput attribute: In this case, you must be VERY careful when you write out the commentText values later. In order to demonstrate these concepts, I created a working sample app here: [link]. You can download the code from the sample as well. You need to be very careful about how you redisplay their input. data). Michael C. Kennedy's Weblog - Monday, October 15, 2012 Decouple WCF Services from their DI Container with Common Instance Factory Service ="CommonInstanceFactory.Sample.Services.GreetingService" %> When you want to change from one DI container to another, all you need to do is replace the Factory attribute with the ServiceHostFactory of the new container. To see examples of using CIF with WCF extensions, download samples and source code from the CIF CodePlex site. In my last blog post I introduced the Common Instance Factory , which I built as an alternative to Common Service Locator to reduce coupling between an application and a Dependency Injection (DI) container. Enjoy. Technical DI WCF DevelopMentor Courses - Saturday, May 26, 2012 | -
| The Best from DevelopMentor | MORE | - Access Control Service v2: Registering Web Identities in your Applications [code]
The relevant parts in the sample are: Configuration. The registration page is handled by a controller with the [Authorize] attribute. You can nicely wrap that in a custom attribute in MVC: [ RegisteredUsersOnly ]. You can download the full solution here. use the standard WIF configuration with passive redirect. This kicks automatically in, whenever authorization fails in the application (e.g. when the user tries to get to an area the requires authentication or needs registration). Checking and transforming incoming claims. incomingPrincipal.Identity.IsAuthenticated). {. www.leastprivilege.com - Saturday, May 21, 2011 - Improving WIF’s Claims-based Authorization - Part 2
In addition I added two attributes that invoke the authorization manager using an “application claim type”. The attribute comes in two flavours: a CAS attribute (invoked by the CLR) and an ASP.NET MVC attribute (for MVC controllers, invoke by the MVC plumbing). The CAS attribute is part of Thinktecture.IdentityModel on Codeplex (or via NuGet: Install-Package Thinktecture.IdentityModel). If you really want to see that code ;) There is also a sample included in the Codeplex donwload. public class ClaimsAuthorize : AuthorizeAttribute. {. return new WIF. www.leastprivilege.com - Wednesday, May 4, 2011 - Improve perceived performance of ASP.NET MVC websites with asynchronous partial views
In the sample case, it’s kind of an iGoogle landing page with different items: TODO, news, etc. Notice how we use the data-url attribute to simplify coordinating the proper location for the content. Check out the live demo I’ve posted here: Sample: Improve Perceived Performance with Async Partial Views. Imagine you’re building an ASP.NET MVC website which has some performance problems. m sure this would never actually happen to you, but imagine you’re facing this problem just for the sake of exploring the possibilities. :-). First a disclaimer / warning. click to enlarge). Michael C. Kennedy's Weblog - Tuesday, November 13, 2012 - Understanding Text Encoding in ASP.NET MVC (ASP.NET MVC Foundations Series)
By default, if you have an action method taking this input, it will just error out with the following message: Error on submit: A potentially dangerous Request.Form value was detected from the client… Of course, we could disable this with a ValidateInput attribute: In this case, you must be VERY careful when you write out the commentText values later. In order to demonstrate these concepts, I created a working sample app here: [link]. You can download the code from the sample as well. You need to be very careful about how you redisplay their input. data). Michael C. Kennedy's Weblog - Monday, October 15, 2012 - WPF MVVM Helper Library (WPF + MVVM = testability)
For example, there was a recent thread on the Mediator pattern (initiated by Marlon Grech and added on by Josh Smith, Laurent Bugnion and others); I already had a message mediator in place but the idea of using an attribute to hook it up was a great one that I adopted into my library just because I like the idea. Just remember I put no guarentee on this code - consider it a sample for you to do whatever you like with. >>. There's been a lot of talk about the Model-View-ViewModel pattern recently and it's usage around the WPF and Silverlight technology stack. So, what all is here? - Improving WIF’s Claims-based Authorization - Part 3 (Usage)
now want to show some samples how I actually use these extensions. The following shows the MVC attribute on the WS-Federation controller: [ ClaimsAuthorize ( Constants. In the previous posts I showed off some of the additions I made to WIF’s authorization infrastructure. The following code snippets are from Thinktecture.IdentityServer on Codeplex. Actions.Issue, Constants. Resources.WSFederation)]. public class WSFederationController : Controller. ClaimsAuthorize ( Constants. Actions.Administration, Constants. Resources.RelyingParty)]. the WRAP endpoint): if (! Actions.Issue)). {. www.leastprivilege.com - Wednesday, May 4, 2011 - Claims Authorization in Geneva Beta 2 - Introduction
Use this sample authorization manager to inspect the data that gets passed in: class SimpleAuthorizationManager : ClaimsAuthorizationManager. {. principal, "Directory" , "Browse" ); var allowed = authz.CheckAccess(simpleContext); You can also use the ClaimsPrincipalPermission/Attribute classes which simplify the call and automate the creation from configuration: new ClaimsPrincipalPermission ( "Directory" , "Browse" ).Demand(); The Geneva SDK includes a sample that shows how to use this extensibility point to parse authorization policy (in the Extensibility folder). www.leastprivilege.com - Friday, July 10, 2009 %>
| | |