Posts

Showing posts from April, 2018

Azure - Manage Blob Storage - Part #2 - Create Blob Container using C#

Image
Problem Definition How to create a blob container using C# in Azure. Prerequisites Access to Azure Portal -  http://portal.azure.com Azure General Purpose Storage Account Microsoft Visual Studio(For this demo used Visual Studio Community for Mac) Storage Account connection string as described in Part #1 Complete Visual studio connectivity to Azure as described in Part #1 Use following code to set up your class "BlobStorageContainer.cs" CloudBlobContainer will use the name that was passed to check if container exists or not. if container does not exists it will be created How to call from "Program.cs" Results Program execution Azure confirmation Resources https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-dotnet?tabs=macos

Azure - Manage Blob Storage - Part #1 - Set up Env

Image
Problem Definition How to set up development environment to manage Blob data files in Azure. Prerequisites Access to Azure Portal -  http://portal.azure.com Azure General Purpose Storage Account Microsoft Visual Studio(Fo this demo used Visual Studio Community for Mac) Create General purpose storage account  Log in to Azure Portal  Look for "Storage Accounts" Click "Add" Choose your settings as you want them to be used. Concentrate on the name for Storage Account, Account Kind, Replication, Performance and Storage Group name. Click create and wait for it to finish. Once done it will start appearing under your storage accounts. In the next step we will extract the key\connection information to set up our Visual Studio Click on any key Connection String and copy it. Install Nuget Package for "WindowsAzure.Storage" it will install dependent packages.  Following image displays references re...

Generics - Constraints

Image
Generics - Constraints Definition When you define a generic class, you can apply restrictions to the kinds of types that client code can use for type arguments when it instantiates your class. If client code tries to instantiate your class by using a type that is not allowed by a constraint, the result is a compile-time error.  [ MSDN ] where T: struct      The type argument must be a value type. Any value type except Nullable can be specified.  where T : class The type argument must be a reference type; this applies also to any class, interface, delegate, or array type. where T : new() The type argument must have a public parameterless constructor. When used together with other constraints, the new() constraint must be specified last. where T :<base class name> The type argument must be or derive from the specified base class. where T :<interface name> The type argument must be or implement the specified interface. Multiple...