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 sealed class MessageBrokerModule : NancyModule | |
{ | |
public MessageBrokerModule() | |
{ | |
Get("/", args => "Service Status OK"); | |
Post("/", args => | |
{ | |
var obj = this.BindAndValidate<RootObject>(); |
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 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; } |
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 static void Main(string[] args) | |
{ | |
var host = new WebHostBuilder() | |
.UseContentRoot(Directory.GetCurrentDirectory()) | |
.UseKestrel() | |
.UseStartup<Startup>() | |
.UseUrls("http://+:88") | |
.Build(); |
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 Microsoft.AspNetCore.Builder; | |
using Microsoft.Extensions.DependencyInjection; | |
using Nancy.Owin; | |
namespace ArmAPI | |
{ | |
public class Startup | |
{ | |
public void Configure(IApplicationBuilder app) | |
{ |
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 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]"; |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<feed xmlns="http://www.w3.org/2005/Atom"> | |
<title type="text">Component Title</title> | |
<id>591c105e-bd42-4008-bcef-d822c1bd7607</id> | |
<updated>2018-03-20T00:00:00Z</updated> | |
<entry> | |
<id>22496D52-F1E2-48DD-970F-93FA3D84F793</id> | |
<title type="text">Component Name</title> | |
<summary type="text">Description...</summary> | |
<published>2018-03-21T00:00:00Z</published> |
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 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) | |
{ |
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
[Produces("application/json")] | |
[Route("api/Sample")] | |
public class SampleController : Controller | |
{ | |
private readonly IHystrixCommand _hystrixCommand; | |
public SampleController(IHystrixCommandFactory hystrixCommandFactory) | |
{ | |
_hystrixCommand = hystrixCommandFactory.GetHystrixCommand("GrupoTeste", "ComandoTeste"); | |
} |
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 Orleans; | |
using Orleans.Runtime.Configuration; | |
using Orleans.Runtime.Host; | |
using System; | |
namespace SiloHostTutorial | |
{ | |
/// <summary> | |
/// Orleans test silo host | |
/// </summary> |
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 Orleans; | |
using ConverterContracts; | |
using System.Threading.Tasks; | |
namespace ConverterGrain | |
{ | |
/// <summary> | |
/// Grain implementation class ConverterGrain. | |
/// </summary> | |
public class ConverterGrain : Grain, IConverter |