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
Here is the list of references that are already there when you create new Web-Empty project in VS 2015 (.Net 4.6.1): | |
1. Microsoft.CodeDom.Providers.DotNetCompilerPlatform | |
2. Microsoft.CSharp | |
3. System | |
4. System.ComponentModel.DataAnnotations | |
5. System.Configuration | |
6. System.Core | |
7. System.Data | |
8. System.Data.DataSetExtensions | |
9. System.Drawing |
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 one was in: https://msdn.microsoft.com/en-us/library/hh834253(v=vs.108).aspx | |
but now is here: Microsoft.AspNet.WebApi.Client | |
and I am tired of forgetting... |
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
To get the list of installed versions: $PSVersionTable | |
To get the list of installed Azure modules: Get-InstalledModule | Out-GridView | |
If yu want to update all modules to latest version: Update-Module |
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
using System; | |
using System.IO; | |
using Microsoft.TeamFoundation.Core.WebApi; | |
using Microsoft.TeamFoundation.SourceControl.WebApi; | |
using Microsoft.VisualStudio.Services.Common; | |
namespace BuildAndDeploy.GetSourceTest | |
{ | |
class Program | |
{ |
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 is a summary of this article: http://yizhang82.me/value-type-boxing | |
using System; | |
interface IAdd | |
{ | |
void Add(int val); | |
} | |
struct Foo : IAdd |
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
private int GenerateRandomNumber() | |
{ | |
int number = 0; | |
byte[] randomNumber = new byte[1]; | |
do | |
{ | |
var rngCsp = new RNGCryptoServiceProvider(); | |
rngCsp.GetBytes(randomNumber); | |
var digit = randomNumber[0] % 10; | |
number = number * 10 + digit; |
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
WITH ROLLBACK IMMEDIATE | |
The ROLLBACK IMMEDIATE command tells the SQL Server that if it can’t complete the command right away, | |
then the other pending transactions should be rolled back. | |
Note: Option will disconnect all other users from the database. | |
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
I had trouble figuring out the message format that Splunk expects when you won't to post a message to exposed http event collector, | |
so there it is for future references since I will forget about it 100% | |
URL: http://localhost:8088/services/collector/event | |
headers: | |
- Authorization = Splunk {your_token} | |
- Content-Type = application/json | |
json payload: | |
{ |
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
# Project 1: | |
Base class: | |
public abstract class BaseRepository | |
{ | |
private protected Task<string> GetEmail(int id) | |
{ | |
return Task.FromResult("username@mail.com"); | |
} | |
} |
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
## Method | |
private static Task<IEnumerable<T>> QueryAnonymAsync<T>(IDbConnection connection, Func<T> typeBuilder, string sql) | |
{ | |
return connection.QueryAsync<T>(sql, typeBuilder); | |
} | |
## Usage | |
return | |
await | |
QueryAnonymAsync(conn, |
OlderNewer