Skip to main content

Posts

WebAPI - Create A Direct Route - Basic

There are 2 places that we may decide on how to handle our routing, although there are more sophisticated technique such as custom attribute, in this article we will discuss on 2 of the basic way to implement ASP.NET Web API routing. 1. At The Method As we can see from the code snipped above, we may decorate the method with a direct routing ( Line 3,8,13 ). The caller may consume it by making a call for example : 1. Return Individual Invoice - http://localhost:xxxxxx/api/invoice/yyyy where the 'xxxxxx' is the port and 'yyyy' is the invoice id. 2. Return All Invoice List - http://localhost:xxxxxx/api/invoices 3. Return Items In Invoices From Invoice ID - http://localhost:xxxxxx/api/invoice/yyyy/items where the 'xxxxxx' is the port and 'yyyy' is the invoice id. 2. At The Controller The code above is a simple web api controller that implement 3 methods. The controller is decorated with a route prefix attribute ( Line 1 ). Notic...

Tools - PostMan

Postman are great tool to perform testing and debugging especially when we are working a lot with web services. Making sure that all the Rest/Soap call return the expected results with the right request header is important in determining your Saas application reliability. Download Postman Now With postman we may debug our call to web services using many Http verbs. Below are some of the example of the verbs that available . There are many cool features such as Header customization, Content-type customization, Security options for each call and many more . When you are developing either WebAPI or Web services, Postman become handy when we know how to use it. Details can be found below Download Or Learn About Postman Now Published on : 13-Jan-2018 Ref no : DDN-WPUB-000055 About Author Wan Mohd Adzha MCPD,MCSD,MCSE I am passionate about technology and of course love Durians. Certified by Microsoft as MCP Since 2011. Blogging from Malaysia

Azure Table Storage - Get Operation

The Requirement Assuming that we have a front end solution and we are going to create a lightweight CMS for its landing page, The landing page has a splash carousel banner that switch between banner automatically, Our mission is to populate the banner list to the front end hooked with Javascript framework and css that is already downloaded to the client browser / Apps. Our CMS team require some sort like a mechanism to publish new banner or delete old banner or take a specific banner online during festive season or offline when it is over. We decided to use Azure Table Storage as our data store and currently developing the data access strategy. Consideration This code base is proposed for the intention for understanding its usage, for production/release we might need to tweak it to meet the company policy, best practice and industry standards. The Model We are using an interface to describe our concrete data model entity The Table Entity In order to use Azure Table Storag...

Azure Table Storage - Putting It All Together

The Requirement Assuming that we already completed the 1.1 Create/Add Azure Table Storage Entity and 1.2 Get All Entities In Azure Table , We are now ready to refactor our simple CRUD operation in a single .dll file that we may reference in our Middle Tier ( Web Api ). Consideration This code base is proposed for the intention for understanding its usage, for production/release we might need to tweak it to meet the company policy, best practice and industry standards. Refactor The Account Setup In the previous implementations, we saw some repeatable code that we may refactor, We start by refactoringg the CloudStorageAccount instantiation in a static class.In the proposed code below, we also introduce an overload for the SetupAccount method , this will allow the reference library open for dynamic variables that may be used in the Middle tier ( in this case, Asp.Net Web API ). Refactor The Add Operation Helper In our code below only 2 methods that are accessible to the c...