This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 MessageBroker | |
{ | |
private ConnectionFactory _factory; | |
private IConnection _connection; | |
private IModel _channel; | |
public string QueueName { get; set; } | |
public void Connect() | |
{ |
This file contains hidden or 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 RabbitMq | |
{ | |
private ConnectionFactory _factory; | |
private IConnection _connection; | |
private IModel _channel; | |
private EventingBasicConsumer _consumer; | |
public string QueueName { get; set; } | |
public RabbitMq(string queuename) | |
{ |
This file contains hidden or 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() | |
{ | |
Console.Clear(); | |
Console.WriteLine("Raspberry Bot Started - Checking your builds"); | |
Console.WriteLine("Connecting to RabbitMQ"); | |
var objRabbit = new RabbitMQ.RabbitMq("AppVeyor"); | |
objRabbit.Connect(); | |
Console.WriteLine("Connected successfully with RabbitMQ!"); |
This file contains hidden or 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) | |
{ | |
var database = "appmetricsdemo"; | |
var uri = new Uri("http://127.0.0.1:8086"); | |
services.AddMetrics(options => | |
{ | |
options.WithGlobalTags((globalTags, info) => | |
{ | |
globalTags.Add("app", info.EntryAssemblyName); |
This file contains hidden or 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 Newtonsoft.Json; | |
using System; | |
using System.Collections.Specialized; | |
using System.Net; | |
using System.Text; | |
//A simple C# class to post messages to a Slack channel | |
//Note: This class uses the Newtonsoft Json.NET serializer available via NuGet | |
public class SlackClient | |
{ |