Introduction to Asp.net Core 1.0

The Diligent Geek

I had a privilege to be invited by Agile Testing Alliance , Vadodara chapter to talk about Asp.net Core 1.0 . It was very interactive sessions and the participants asked some really good questions.

Here is the synopsis of my talk

What is Asp.net Core ?

It is a lean stack from Microsoft to develop the modern web apps built from ground up and is most revolutionary version since asp.net first was released in 2002
Today it is available RC1 update 1 which comes with golive license so this means that this framework is production ready.

Cross platform

This is a game changer and USP about this framework.  It works seamlessly on Windows, OSX and Linux. The same code base runs directly on the metal, and remember this is different from the Mono Framework. In fact the CoreClr is around 11 meg and is shipped along with your application as…

View original post 540 more words

Advertisements

ASP.NET Core MVC API documentation using Swashbuckle Swagger

Software Engineering

This article shows how to document your ASP.NET Core 1.0 MVC API using Swagger with Swashbuckle. Per default, it does not use your xml comments in the code and this needs to be configured if required.

Code: https://github.com/damienbod/AspNet5GeoElasticsearch

2017.02.12 Updated to VS2017, msbuild and Swashbuckle.AspNetCore
2016.07.03 Updated to ASP.NET Core RTM
2016.06.04 Updated to ASP.NET Core RC2 dotnet

Step 1: Add the required NuGet packages to the dependencies in the project csproj file.

Step 2: Produce the .xml file which contains the xml comments when building. Click the produce outputs on build checkbox in your project file.

SwaggerProjectConfig

Or set the ProduceOutputsOnBuild property in the project csproj file.

Step 3: Configure Swashbuckle.SwaggerGen in the Startup class ConfigureServices method.

You need to define your path to the comments xml file, which can be found in the artifacts folder. This should be saved in a config file.

The ConfigureSwaggerDocument with OperationFilter method is…

View original post 51 more words

Connecting to the Azure IoT Hub using an AMQP stack

DEVEXPERIENCE

Accessing to the Azure IoT Hub service is so simple using all the available SDKs that Microsoft provides as open source on GitHub. We can laverage on more different languages for different platforms : from C# for .Net and UWP (Universal Windows Platform) applications to Java, from NodeJS (using JavaScript) to C. In this way, we are able to coverage different hardware from higher level devices like BeagleBoard, Raspberry Pi 2, Minnowboard Max to very low constrained devices like Kinetis K64F (Freescale) and CC3200 (Texas Instruments).

Of course, using directly HTTP and AMQP protocols, we can access to the IoT Hub from other platforms (not certified yet) and it could be the scenario of the .Net Micro Framework because up to now there isn’t an official SDK for it. The current C# client implementation uses Task and async/await programming model very heavily that isn’t supported (yet) by the “little” child in the .Net frameworks family. One choice to connect…

View original post 1,373 more words

RabbitMQ on Raspberry Pi

Tobias Abarbanell

Playing around with RabbitMQ lately, I was interested how it would perform on a very small box, a
Raspberry Pi.

Here is a short description how to get RabbitMQ running on a Raspberry Pi.

  1. get a Raspberry Pi installed with Raspbian – just follow the standard installation guide from http://www.raspberrypi.org/downloads/
  2. get the rabbit MQ package from here: http://www.rabbitmq.com/install-debian.html
  3. I wanted to run a client in Node.js, so I got the latest node with these commands:

    wget http://node-arm.herokuapp.com/node_latest_armhf.deb
    sudo dpkg -i node_latest_armhf.deb
    node -v
  4. pick the node version of the RabbitMQ tutorials from here: https://github.com/squaremo/amqp.node/tree/master/examples/tutorials

Here is how this looks in pictures:

Raspberry Pi running RabbitMQ Raspberry Pi running RabbitMQ node.js client running with rabbitMQ on a Raspberry Pi node.js client running with rabbitMQ on a Raspberry Pi

And the results: If you let a publisher with a simple “hello world” message run in a loop for 1000 times and start a subscriber for this queue at the same time, you will see…

View original post 103 more words

How to create generation 2 virtual machine using PowerShell?

My Space

Below script would help to create virtual machine in Hyper-V using PowerShell-

  1. Open PowerShell window as admin.
  2. Paste below script and hit enter.
  3. VM would be created.
  4. Open Hyper-V Manager and verify it.

# Set VM Name, Switch Name, and Installation Media Path.
$VMName = ‘TestVM’
# Switch is nothing but network adapter
$Switch = ‘My New Virtual Switch’
#OS Iso file should be assigned to InstallMedia
$InstallMedia = ‘D:Softwaresen_windows_10_enterprise_version_1607_updated_jul_2016_x64_dvd_9054264.iso’

# Create New Virtual Machine
# MemoryStartupBytes contents the RAM size of VM.
# NewVHDSizeBytes contents the size of HD.
New-VM -Name $VMName -MemoryStartupBytes 1073741824 -Generation 2 -NewVHDPath “C:UsersPublicDocumentsHyper-VVirtual Hard Disks$VMName.vhdx” -NewVHDSizeBytes 53687091200 -Path “C:ProgramDataMicrosoftWindowsHyper-V$VMName” -SwitchName $Switch

# Add DVD Drive to Virtual Machine
Add-VMScsiController -VMName $VMName
Add-VMDvdDrive -VMName $VMName -Path $InstallMedia

# Mount Installation Media
$DVDDrive = Get-VMDvdDrive -VMName $VMName

# Configure Virtual Machine to Boot from DVD
Set-VMFirmware -VMName $VMName -FirstBootDevice $DVDDrive

View original post

Define index and other constraints in Python and SQLAlchemy

Howdy Reader,

This is something for Python Flask developers.
While developing application we usually come across the situation where data fetch is little slow and it is not working as expected. If we are fresher in any kind of Database technologies then we might think that OHH, it is more data(probably max 2K products from single table which only has plain data, no Images or such that and having total of 2K records) and it can be slow. But once you are little experienced you would know that something is missing. First thing that needs to be checked on such scenarios that are you reading any other whole table?(i.e. if you want user specific products, are you reading whole product table, whole user table and then filtering in python or you are doing proper joins?), second thing that needs to be looked at indexes, are they required, if so then create it.
Any ways that theory was for fresher but for how to create constraints and indexes using SQLAlchemy, please look at this link.