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.Linq; | |
using System.Web; | |
using System.Web.Mvc; | |
using Hangfire; | |
using HangfireDemo.Models; | |
using Microsoft.Win32.SafeHandles; | |
namespace HangfireDemo.Controllers |
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.Net; | |
using System.Net.Mail; | |
.... | |
public class EmailSender | |
{ | |
public static bool SendEmail(int id) | |
{ | |
try |
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 Hangfire; | |
using Hangfire.SqlServer; | |
..... | |
public partial class Startup | |
{ | |
public void Configuration(IAppBuilder app) | |
{ | |
var options = new SqlServerStorageOptions |
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 ApplicationDbContext : IdentityDbContext<ApplicationUser> | |
{ | |
public ApplicationDbContext() | |
: base("DefaultConnection", throwIfV1Schema: false) | |
{ | |
} | |
public DbSet<EmailMessage> EmailMessages { 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
public class EmailMessage | |
{ | |
[Key] | |
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] | |
public int Id { get; private set; } | |
public string FromEmail { get; set; } | |
public string ToEmail { get; set; } | |
public string Subject { get; set; } | |
public string Body { get; set; } | |
public bool SendNow { 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
using System; | |
using Akka.Actor; | |
namespace ConsoleApplication1 | |
{ | |
internal class Program | |
{ | |
private static void Main(string[] args) | |
{ | |
var smsActorSystem = ActorSystem.Create("SmsActorSystem"); | |
Console.WriteLine("Actor System Created"); |
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 Akka.Actor; | |
namespace ConsoleApplication1 | |
{ | |
public class SmsSenderActor : ReceiveActor | |
{ | |
public SmsSenderActor() | |
{ | |
Receive<string>(message => Console.WriteLine(message)); |
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 ConsoleApplication1 | |
{ | |
public class SmsMessage | |
{ | |
public SmsMessage(string senderNumber, string receiverNumber, string message) | |
{ | |
SenderNumber = senderNumber; | |
ReceiverNumber = receiverNumber; |
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 Akka.Actor; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var smsActorSystem = ActorSystem.Create("SmsActorSystem"); | |
Console.WriteLine("Actor System Created"); |
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 Akka.Actor; | |
namespace ConsoleApplication1 | |
{ | |
public class SmsSenderActor : ReceiveActor | |
{ | |
public SmsSenderActor() | |
{ | |
Receive<string>(message => Console.WriteLine(message)); |