|
|
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.
|
2 Articles match "Return","Sample"
|
Related DevelopMentor Courses
|
MORE
|
|
Essential Windows Communication Foundation 3.5 - WCF
To facilitate the process, WCF provides various support mechanisms for managing faults and returning errors to clients. We learn how to deal with exceptions, properly return error codes, and even customize the error handling of the framework itself. We cover several samples of commonly needed functionality at the XML programming layer, working with namespaces, XPATH, and LINQ to XML. Windows Communication Foundation (WCF) replaces previous technologies such as.NET remoting, ASMX, and COM+. You'll get answers to these questions: How do I design services using contracts?
DevelopMentor Courses
- Friday, April 16, 2010
Essential Windows Communication Foundation
To facilitate the process, WCF provides various support mechanisms for managing faults and returning errors to clients. We learn how to deal with exceptions, properly return error codes, and even customize the error handling of the framework itself. We cover several samples of commonly needed functionality at the XML programming layer, working with namespaces, XPATH, and LINQ to XML. Windows Communication Foundation (WCF) replaces previous technologies such as.NET remoting, ASMX, and COM+. You'll get answers to these questions: How do I design services using contracts?
DevelopMentor Courses
- Friday, June 12, 2009
|
41 Articles match "Return","Sample"
|
The Latest from DevelopMentor
|
MORE
|
|
WIF, ASP.NET 4.0 and Request Validation
The WIF SDK (v4) contains a sample validator that does exactly that: public class WSFedRequestValidator : RequestValidator. {. return true ; }. }. return base.IsValidRequestString(. Since the response of a WS-Federation sign-in request contains XML, the ASP.NET built-in request validation will trigger an exception. To solve this, request validation needs to be turned off for pages receiving such a response message. Starting with ASP.NET 4.0 you can plug in your own request validation logic. protected override bool IsValidRequestString(. WSFederationConstants. null ). {.
www.leastprivilege.com
- Saturday, July 24, 2010
Thinktecture.IdentityModel: WRAP and SWT Support
var client = new WrapClient (wrapEp); var swt = client.Issue(issuerName, issuerKey, scope); All Issue overrides return a SimpleWebToken type, which brings me to the next helper class. The following sample code generates a SWT token using the helper class: private static string CreateSwtToken(). {. issuer, audience, Convert.FromBase64String(signingKey)); token.AddClaim( ClaimTypes.Name, "dominick" ); token.AddClaim( ClaimTypes.Role, "Users" ); token.AddClaim( ClaimTypes.Role, "Administrators" ); token.AddClaim( "simple" , "test" ); return token.ToString(); }.
www.leastprivilege.com
- Sunday, May 9, 2010
Thinktecture.IdentityModel: WIF Support for WCF REST Services and OData
This sample is also included in the codeplex download along a similar sample for plain WCF REST services. get { return GetClaims().AsQueryable(); Id = ++id, ClaimType = claim.ClaimType, Value = claim.Value, Issuer = claim.Issuer. }); }); return claims; }. }. new FederatedWebServiceAuthorizationManager (); host.Authorization.PrincipalPermissionMode = PrincipalPermissionMode.Custom; return host; }. }. The last step is to set up the.svc file to use the service host factory (see the sample download). support for SAML and SWT tokens. public IQueryable.
www.leastprivilege.com
- Wednesday, May 5, 2010
|
-
|
The Best from DevelopMentor
|
MORE
|
-
Random Sampling extension method
Had reason recently to select a random sample of data from a stream of elements. The amount of samples I needed to take was finite but what was unknown was the number of elements in the input stream. managed to find various implementations of an IEnumerable extension method on the net, but all the ones I found would cache the entire stream before selecting the sample. After a look around I found this blog article that describes how to implement Reservoir sampling without the need to keep all the items.
.NET Mutterings
- Wednesday, October 1, 2008
-
Using IdentityModel: Some Samples
Constants.OrderHistoryClaimType, Constants.ApplicationIssuerIdentityClaim); var orders = orderHistory.Get >(); or some authorization code from my CardSpace sample app - thanks to the unified authorization model, I can share this method across ASP.NET, ASMX and WCF: public static IEnumerable. return boards; }. Here are some typical usage scenario of IdentityPrincipal in ASP.NET. GetBoardsForUser(. AuthorizationContext context, bool includePublic). {. boards = new List (); foreach ( Claim typeClaim in context.ClaimSets.FindClaims(. string type = typeClaim.Get (); if ( "Public".Equals(type)
www.leastprivilege.com
- Saturday, March 22, 2008
-
Using Model – View – ViewModel with Silverlight
Even thought the UI technology used doesn't change the basic MVVM pattern there are some subtle differences, like not easily being able to use ICommand in Silverlight, so I decided to create a small Silverlight sample. know it is a bit of a lame business rule but it is just a sample. 12: get { return _firstName; }. 22: get { return _lastName; }. 34: get { return FirstName + " " + LastName; }. 24: get { return _model; }. 48: get { return Model.FirstName; }. 53: get { return Model.LastName; }. 11: {. 13: set. 14: {. 19: }.
The Problem Solver
- Tuesday, April 7, 2009
-
WF4&WCF and message correlation
Request = receive2, Value = new InArgument ( "The second result" ). }; result.Activities.Add(reply2); return result; }. Namespaces = new XmlNamespaceManager( new NameTable()), Expression = "//sample:Person/sample:Id" }; xpath.Namespaces.AddNamespace( "sample" , "urn:WF4Sample:person" ); var messageQuerySet = new MessageQuerySet(). {. Name = "RequestCorrelation" }; messageQuerySet.Add( "PersonId" , xpath); result.Select = messageQuerySet; return result; }. Fortunately the WF4 story is much better. Conclusion.
The Problem Solver
- Wednesday, September 2, 2009
-
Article: Avoiding 5 Common Pitfalls in Unit Testing
As the months went by, however, we discovered that the hardships we remembered had not returned. To = to, From = from, Body = "Sample", Subject = "test" }; mail.SetFormat( Formats.Html ); mockMailServer.Send( mail ); } return from; }. IRunner)Activator.CreateInstance(Type.GetType(path)); return instance.ExecuteRequest(environment); } private void AssertValidClass(string path) { if (!IsValidForMask(Mask, Replace("*", ".*"); Regex regex = new Regex(mask); return regex.IsMatch(path); } }. You can read it at the DevelopMentor website: [link]. Enjoy! So we stopped.
Michael C. Kennedy's Weblog
- Thursday, August 6, 2009
-
Significant Advances in Unit Testing Windows Workflow
Download the library with sample test project here: Kennedy.WorkflowTesting.zip (216 KB). don't have to write about that now, but you'll see it used in the sample with my library. Untyped name/value collections as input : Using untyped name/value collections as input and return values is error prone (for testing and general use). The Sample: Let me set the stage first before we see the test code. Most Remarkably : We are getting the actual instance of the activity returned to us so that we can explore its properties. You can also just jump to the code. Enjoy!
Michael C. Kennedy's Weblog
- Sunday, January 18, 2009
-
EF 4.0 N-Tier Support: Take 2
You can download the sample application I created here. For convenience I’m using the Northwind sample database. public Order GetOrder( int orderId) { using ( NorthwindEntities ctx = new NorthwindEntities ()) { // Eager-load related entities var query = from o in ctx.Orders.Include( "OrderDetails.Product" ) where o.OrderID == orderId select o; Order order = query.SingleOrDefault(); return order; } }. The method should return the order that was saved in order to provide database-generated values (such as identity and concurrency fields).
Tony and Zuzana's World
- Thursday, November 12, 2009
|
|
|