Skip to content

Instantly share code, notes, and snippets.

View thiagoloureiro's full-sized avatar
🚗
Coding

Thiago thiagoloureiro

🚗
Coding
View GitHub Profile
public sealed class MessageBrokerModule : NancyModule
{
public MessageBrokerModule()
{
Get("/", args => "Service Status OK");
Post("/", args =>
{
var obj = this.BindAndValidate<RootObject>();
public class RootObject
{
public string eventName { get; set; }
public EventData eventData { get; set; }
}
public class Artifact
{
public string permalink { get; set; }
public string fileName { get; set; }
private static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseKestrel()
.UseStartup<Startup>()
.UseUrls("http://+:88")
.Build();
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Nancy.Owin;
namespace ArmAPI
{
public class Startup
{
public void Configure(IApplicationBuilder app)
{
public class UserRepository : IUserRepository
{
public List<User> SelectUser()
{
// Select
List<User> ret;
using (var db = new SqlConnection(connstring))
{
const string sql = @"SELECT Id, Name, Surname, Email, Phone, LastLogon, CreatedOn, ActivationCode, Login, Password, Token, LoginToken, CPF, Birth, ProfileImage, DeviceToken FROM [User]";
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.AddHystrix();
services.Configure<HystrixOptions>(options => Configuration.GetSection("Hystrix").Bind(options));
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
[Produces("application/json")]
[Route("api/Sample")]
public class SampleController : Controller
{
private readonly IHystrixCommand _hystrixCommand;
public SampleController(IHystrixCommandFactory hystrixCommandFactory)
{
_hystrixCommand = hystrixCommandFactory.GetHystrixCommand("GrupoTeste", "ComandoTeste");
}
using Orleans;
using Orleans.Runtime.Configuration;
using Orleans.Runtime.Host;
using System;
namespace SiloHostTutorial
{
/// <summary>
/// Orleans test silo host
/// </summary>
using Orleans;
using ConverterContracts;
using System.Threading.Tasks;
namespace ConverterGrain
{
/// <summary>
/// Grain implementation class ConverterGrain.
/// </summary>
public class ConverterGrain : Grain, IConverter