-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from daenetCorporation/master
.NET Sample migrated to .NET Core
- Loading branch information
Showing
12 changed files
with
137 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,78 @@ | ||
//---------------------------------------------------------------------------------- | ||
// Microsoft Azure Storage Team | ||
// | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// | ||
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, | ||
// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES | ||
// OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. | ||
//---------------------------------------------------------------------------------- | ||
// The example companies, organizations, products, domain names, | ||
// e-mail addresses, logos, people, places, and events depicted | ||
// herein are fictitious. No association with any real company, | ||
// organization, product, domain name, email address, logo, person, | ||
// places, or events is intended or should be inferred. | ||
//---------------------------------------------------------------------------------- | ||
|
||
using System; | ||
|
||
namespace QueueStorage | ||
{ | ||
|
||
/// <summary> | ||
/// Azure Queue Service Sample - The Queue Service provides reliable messaging for workflow processing and for communication | ||
/// between loosely coupled components of cloud services. This sample demonstrates how to perform common tasks including | ||
/// inserting, peeking, getting and deleting queue messages, as well as creating and deleting queues. | ||
/// | ||
/// Note: This sample uses the .NET 4.5 asynchronous programming model to demonstrate how to call the Storage Service using the | ||
/// storage client libraries asynchronous API's. When used in real applications this approach enables you to improve the | ||
/// responsiveness of your application. Calls to the storage service are prefixed by the await keyword. | ||
/// | ||
/// Documentation References: | ||
/// - What is a Storage Account - http://azure.microsoft.com/en-us/documentation/articles/storage-whatis-account/ | ||
/// - Getting Started with Queues - http://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-how-to-use-queues/ | ||
/// - Queue Service Concepts - http://msdn.microsoft.com/en-us/library/dd179353.aspx | ||
/// - Queue Service REST API - http://msdn.microsoft.com/en-us/library/dd179363.aspx | ||
/// - Queue Service C# API - http://go.microsoft.com/fwlink/?LinkID=398944 | ||
/// - Storage Emulator - http://msdn.microsoft.com/en-us/library/azure/hh403989.aspx | ||
/// - Asynchronous Programming with Async and Await - http://msdn.microsoft.com/en-us/library/hh191443.aspx | ||
/// </summary> | ||
public class Program | ||
{ | ||
// ************************************************************************************************************************* | ||
// Instructions: This sample can be run using either the Azure Storage Emulator that installs as part of this SDK - or by | ||
// updating the App.Config file with your AccountName and Key. | ||
// | ||
// To run the sample using the Storage Emulator (default option) | ||
// 1. Start the Azure Storage Emulator (once only) by pressing the Start button or the Windows key and searching for it | ||
// by typing "Azure Storage Emulator". Select it from the list of applications to start it. | ||
// 2. Set breakpoints and run the project using F10. | ||
// | ||
// To run the sample using the Storage Service | ||
// 1. Open the app.config file and comment out the connection string for the emulator (UseDevelopmentStorage=True) and | ||
// uncomment the connection string for the storage service (AccountName=[]...) | ||
// 2. Create a Storage Account through the Azure Portal and provide your [AccountName] and [AccountKey] in | ||
// the App.Config file. See http://go.microsoft.com/fwlink/?LinkId=325277 for more information | ||
// 3. Set breakpoints and run the project using F10. | ||
// | ||
// ************************************************************************************************************************* | ||
public static void Main() | ||
{ | ||
Console.WriteLine("Azure Storage Queue Sample\n"); | ||
|
||
// Create queue, insert message, peek message, read message, change contents of queued message, | ||
// queue 20 messages, get queue length, read 20 messages, delete queue. | ||
GettingStarted getStarted = new GettingStarted(); | ||
getStarted.RunQueueStorageOperationsAsync().Wait(); | ||
|
||
// Get list of queues in storage account. | ||
Advanced advMethods = new Advanced(); | ||
advMethods.RunQueueStorageAdvancedOpsAsync().Wait(); | ||
|
||
Console.WriteLine("Press any key to exit."); | ||
Console.Read(); | ||
} | ||
|
||
|
||
} | ||
} | ||
//---------------------------------------------------------------------------------- | ||
// Microsoft Azure Storage Team | ||
// | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// | ||
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, | ||
// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES | ||
// OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. | ||
//---------------------------------------------------------------------------------- | ||
// The example companies, organizations, products, domain names, | ||
// e-mail addresses, logos, people, places, and events depicted | ||
// herein are fictitious. No association with any real company, | ||
// organization, product, domain name, email address, logo, person, | ||
// places, or events is intended or should be inferred. | ||
//---------------------------------------------------------------------------------- | ||
|
||
using System; | ||
|
||
namespace QueueStorage | ||
{ | ||
|
||
/// <summary> | ||
/// Azure Queue Service Sample - The Queue Service provides reliable messaging for workflow processing and for communication | ||
/// between loosely coupled components of cloud services. This sample demonstrates how to perform common tasks including | ||
/// inserting, peeking, getting and deleting queue messages, as well as creating and deleting queues. | ||
/// | ||
/// Note: This sample uses the .NET 4.5 asynchronous programming model to demonstrate how to call the Storage Service using the | ||
/// storage client libraries asynchronous API's. When used in real applications this approach enables you to improve the | ||
/// responsiveness of your application. Calls to the storage service are prefixed by the await keyword. | ||
/// | ||
/// Documentation References: | ||
/// - What is a Storage Account - http://azure.microsoft.com/en-us/documentation/articles/storage-whatis-account/ | ||
/// - Getting Started with Queues - http://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-how-to-use-queues/ | ||
/// - Queue Service Concepts - http://msdn.microsoft.com/en-us/library/dd179353.aspx | ||
/// - Queue Service REST API - http://msdn.microsoft.com/en-us/library/dd179363.aspx | ||
/// - Queue Service C# API - http://go.microsoft.com/fwlink/?LinkID=398944 | ||
/// - Storage Emulator - http://msdn.microsoft.com/en-us/library/azure/hh403989.aspx | ||
/// - Asynchronous Programming with Async and Await - http://msdn.microsoft.com/en-us/library/hh191443.aspx | ||
/// </summary> | ||
public class Program | ||
{ | ||
// ************************************************************************************************************************* | ||
// Instructions: This sample can be run using either the Azure Storage Emulator that installs as part of this SDK - or by | ||
// updating the App.Config file with your AccountName and Key. | ||
// | ||
// To run the sample using the Storage Emulator (default option) | ||
// 1. Start the Azure Storage Emulator (once only) by pressing the Start button or the Windows key and searching for it | ||
// by typing "Azure Storage Emulator". Select it from the list of applications to start it. | ||
// 2. Set breakpoints and run the project using F10. | ||
// | ||
// To run the sample using the Storage Service | ||
// 1. Open the app.config file and comment out the connection string for the emulator (UseDevelopmentStorage=True) and | ||
// uncomment the connection string for the storage service (AccountName=[]...) | ||
// 2. Create a Storage Account through the Azure Portal and provide your [AccountName] and [AccountKey] in | ||
// the App.Config file. See http://go.microsoft.com/fwlink/?LinkId=325277 for more information | ||
// 3. Set breakpoints and run the project using F10. | ||
// | ||
// ************************************************************************************************************************* | ||
public static void Main() | ||
{ | ||
Console.WriteLine("Azure Storage Queue Sample\n"); | ||
|
||
// Create queue, insert message, peek message, read message, change contents of queued message, | ||
// queue 20 messages, get queue length, read 20 messages, delete queue. | ||
GettingStarted getStarted = new GettingStarted(); | ||
getStarted.RunQueueStorageOperationsAsync().Wait(); | ||
|
||
// Get list of queues in storage account. | ||
Advanced advMethods = new Advanced(); | ||
advMethods.RunQueueStorageAdvancedOpsAsync().Wait(); | ||
|
||
Console.WriteLine("Press any key to exit."); | ||
Console.Read(); | ||
} | ||
|
||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Azure.Storage.Queue" Version="11.1.7" /> | ||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0-preview.4.20251.6" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Update="appsettings.json"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</None> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 14 | ||
VisualStudioVersion = 14.0.23107.0 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.29911.84 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QueueStorage", "QueueStorage\QueueStorage.csproj", "{2F53D824-D081-4281-81E5-38C7B35C965B}" | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QueueStorage", "QueueStorage.csproj", "{30EC1C93-9BEC-477E-9E24-C2AD1016DFD3}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{2F53D824-D081-4281-81E5-38C7B35C965B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{2F53D824-D081-4281-81E5-38C7B35C965B}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{2F53D824-D081-4281-81E5-38C7B35C965B}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{2F53D824-D081-4281-81E5-38C7B35C965B}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{30EC1C93-9BEC-477E-9E24-C2AD1016DFD3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{30EC1C93-9BEC-477E-9E24-C2AD1016DFD3}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{30EC1C93-9BEC-477E-9E24-C2AD1016DFD3}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{30EC1C93-9BEC-477E-9E24-C2AD1016DFD3}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {69D79CDC-5479-4F3B-BA43-127BBEE4E0E7} | ||
EndGlobalSection | ||
EndGlobal |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.