Posts

Showing posts from June, 2019

Implement Open API specification in .NET Core Web API using Swagger.

Image
Documentation is always crucial part of development, developers can always check that API is available or not before creating a new one. Swagger is a great framework to use when it comes to API documentation. It's  not only provide the UI but also provide an OpenAPI specification which is used to create client for using the API. Using this specification and Swagger Codegen, you can create client for c#, angular and many more. The purpose of this post is not just to implement swagger but also to describe how you can specify other OpenAPI specification properties like schemes and hosts which is important when you are working with Azure API management. Prerequisites  To follow along you need  Visual studio 2017 Let's Get Started Step 1 : Create a .NET Core API using Visual studio 2017. Step 2 : Remove existing controller and create a new empty controller and name it UserController. Step 3 : Add the following acti

Azure Search - Load Data

Image
This is the third post of blog series on Azure search. In previous post I explain how we can Provision Azure service and how we can create Index . In this post I am going to show you how we can load the data in Azure search service. Now you can import the data which is already present in Azure services like SQL, Blob storage etc or you can import data from other service using code. If  you use existing service, it is going to be a pull operation where indexer will crawl over your data and create indexes. Here I will be explaining how we can push the data to Azure search using .NET SDK. Before jumping on code, let's take a moment and understand what are actions. Actions are nothing but the operations performed on data on the service, these operation can be Upload : Will upload a new record in index. Delete : Will delete an existing record. Merge : Will merge the records with the existing one. Merge Or Upload : Merge if exist otherwise upload the document. Now

Azure Search-Create Index

Image
This is the second post in the series of implementing Azure search. In previous post I described what Azure search is and how can implement it. As discussed in previous post, implementation of Azure search is four step job. Provision Service Create Index Load Data Finally Search. Let's get started. Create Index You can create index from portal as well as code. In this post I will be using the code to create the index and also give the overview to create index from the portal. Overview from portal Let's  go ahead and click on Add Index button on overview screen. Here you will see  Name of the Index Fields: You can insert as many fields as you want. You can also select whether it should be searchable, sortable, filterable, etc.. From Code For this demo I will be using VS 2017 Go ahead and create a .NET core MVC product using visual studio. Install Microsoft.Azure.Search nuget package.  From portal  Copy the Name of the Azure Search.

Azure Search

Image
Today any application you work on, it requires search functionality. For end user search is just a input box where he/she can search whatever they want but implementing search is always difficult because its not just about giving back the result but also giving back the result quickly. To address this problem Microsoft provides the powerful service called Azure service. It is search as a service where you need to focus on the functionality other then search. Let's understand what is azure search and how you can implement in your application. Please note this post is focused on how to implement search instead of, what azure search is. What is Azure Search? Azure search is search as a service which gives you power to  Full text search Search from the document content User experience features Auto complete  Search suggestions Synonyms Sorting Paging There are many more features. You can find it here. How to use Azure Search? Its a four step job.