Elapsed | Title |
---|---|
00:00:01.4098212 | ADO Puro |
00:00:01.4771617 | Dapper |
00:00:06.1009449 | Entity Framework |
00:00:01.6514433 | Entity Framework Fast |
00:00:06.5666193 | NHibernate |
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; | |
namespace ConsoleApp2 | |
{ | |
class Program | |
{ | |
private static readonly Type StringType = typeof(string); | |
static void Main(string[] args) | |
{ |
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
var store = new X509Store("MY"); | |
store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly); | |
var collection2 = store.Certificates.Find(X509FindType.FindByKeyUsage, X509KeyUsageFlags.DigitalSignature, false); | |
var scollection = X509Certificate2UI.SelectFromCollection(collection2, "Certificado(s) Digital(is) disponível(is)", "Selecione o certificado digital para uso no aplicativo", X509SelectionFlag.SingleSelection); |
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.Collections.Generic; | |
using System.Linq; | |
using System.Net; | |
using System.Net.Http; | |
using System.Text; | |
using System.Web.Http; | |
using System.Web.Http.Description; | |
namespace MeuProjeto.Web.Controllers.Api | |
{ |
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.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Net; | |
using System.Net.Http; | |
using System.Net.Http.Formatting; | |
using System.Net.Http.Headers; | |
using System.Reflection; | |
using System.Threading.Tasks; |
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
interface IConnectionString | |
{ | |
string ObterConnectionDoClienteString(); | |
} | |
class ConnectionString : IConnectionString | |
{ | |
private Dicitionary<string, string> _connectionStrings = new Dicitionary<string, string>(); | |
public string ObterConnectionDoClienteString() |
ç e acento
somente acento
Fonte: https://sqlfromhell.wordpress.com/2010/05/01/ignorando-letras-maiusculas-minusculas-acentos-e-c/
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
public struct OperationResult<T> | |
{ | |
public T Result { get; set; } | |
public Exception Exception { get; } | |
public bool IsSuccess { get; } | |
public OperationResult(T result) | |
{ | |
IsSuccess = true; | |
Exception = null; |
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
public static class FluentEFTypeMappingGenerator | |
{ | |
private static bool _theKeyIsAlrearyWriten; | |
private static XDocument _documentationXml; | |
public static string GenerateForClass<T>() | |
{ | |
var mainType = typeof(T); | |
var assemblyLocation = mainType.Assembly.Location; | |
var xmlFileDocumentation = Path.ChangeExtension(Path.Combine(Path.GetDirectoryName(assemblyLocation), Path.GetFileName(assemblyLocation)), "xml"); |
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
mkdir c:\mustinstall | |
@powershell -command "& { (New-Object Net.WebClient).DownloadFile('https://download.microsoft.com/download/C/F/F/CFF3A0B8-99D4-41A2-AE1A-496C08BEB904/WebPlatformInstaller_amd64_en-US.msi', 'c:\mustinstall\webpi.msi') }" | |
msiexec /i c:\mustinstall\webpi.msi /quiet | |
cd "C:\Program Files\Microsoft\Web Platform Installer" | |
WebpiCmd.exe /Install /Products:ApplicationInsightsStatusMonitor /AcceptEula |