diff --git a/TwilioSMSReceiver/Controllers/MSTeamsWebHooksController.cs b/TwilioSMSReceiver/Controllers/MSTeamsWebHooksController.cs index 44a6674..b89bee4 100644 --- a/TwilioSMSReceiver/Controllers/MSTeamsWebHooksController.cs +++ b/TwilioSMSReceiver/Controllers/MSTeamsWebHooksController.cs @@ -7,7 +7,8 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using TwilioSMSReceiver; -using TwilioSMSReceiver.Models; +using TwilioSMSReceiver.Data; +using TwilioSMSReceiver.Data.Models; namespace TwilioSMSReceiver.Controllers { diff --git a/TwilioSMSReceiver/Controllers/SMSReceiverController.cs b/TwilioSMSReceiver/Controllers/SMSReceiverController.cs index 26c2b6d..259e2c4 100644 --- a/TwilioSMSReceiver/Controllers/SMSReceiverController.cs +++ b/TwilioSMSReceiver/Controllers/SMSReceiverController.cs @@ -8,8 +8,9 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Twilio.AspNet.Common; using TwilioSMSReceiver; +using TwilioSMSReceiver.Data; +using TwilioSMSReceiver.Data.Models; using TwilioSMSReceiver.Interfaces; -using TwilioSMSReceiver.Models; namespace TwilioSMSReceiver.Controllers { diff --git a/TwilioSMSReceiver/Interfaces/BaseHandler.cs b/TwilioSMSReceiver/Interfaces/BaseHandler.cs index db50aa0..fe15287 100644 --- a/TwilioSMSReceiver/Interfaces/BaseHandler.cs +++ b/TwilioSMSReceiver/Interfaces/BaseHandler.cs @@ -1,5 +1,6 @@ #nullable disable -using TwilioSMSReceiver.Models; +using TwilioSMSReceiver.Data; +using TwilioSMSReceiver.Data.Models; namespace TwilioSMSReceiver.Interfaces { diff --git a/TwilioSMSReceiver/Interfaces/IMessageHandler.cs b/TwilioSMSReceiver/Interfaces/IMessageHandler.cs index 9651935..5853803 100644 --- a/TwilioSMSReceiver/Interfaces/IMessageHandler.cs +++ b/TwilioSMSReceiver/Interfaces/IMessageHandler.cs @@ -1,4 +1,4 @@ -using TwilioSMSReceiver.Models; +using TwilioSMSReceiver.Data.Models; namespace TwilioSMSReceiver.Interfaces { diff --git a/TwilioSMSReceiver/Interfaces/MSTeamsHandler.cs b/TwilioSMSReceiver/Interfaces/MSTeamsHandler.cs index a7e38a8..7f44e29 100644 --- a/TwilioSMSReceiver/Interfaces/MSTeamsHandler.cs +++ b/TwilioSMSReceiver/Interfaces/MSTeamsHandler.cs @@ -1,4 +1,4 @@ -using TwilioSMSReceiver.Models; +using TwilioSMSReceiver.Data.Models; using TeamsHook.NET; namespace TwilioSMSReceiver.Interfaces diff --git a/TwilioSMSReceiver/Interfaces/SMTPHandler.cs b/TwilioSMSReceiver/Interfaces/SMTPHandler.cs index dbb2542..02a2d3d 100644 --- a/TwilioSMSReceiver/Interfaces/SMTPHandler.cs +++ b/TwilioSMSReceiver/Interfaces/SMTPHandler.cs @@ -1,4 +1,4 @@ -using TwilioSMSReceiver.Models; +using TwilioSMSReceiver.Data.Models; namespace TwilioSMSReceiver.Interfaces { diff --git a/TwilioSMSReceiver/Models/SMSModel.cs b/TwilioSMSReceiver/Models/SMSModel.cs deleted file mode 100644 index c28b07f..0000000 --- a/TwilioSMSReceiver/Models/SMSModel.cs +++ /dev/null @@ -1,36 +0,0 @@ -#nullable disable -using Microsoft.EntityFrameworkCore; -using System.ComponentModel.DataAnnotations; - -namespace TwilioSMSReceiver.Models -{ - public class SMSModel - { - [Key] - public int Id { get; set; } - [Required] - public string ReceivedNumber { get; set; } - - [Required] - public string SenderNumber { get; set; } - public DateTime TimeReceived { get; set; } - public string? MessageContents { get; set; } - public ICollection MMSContent { get; set; } - public bool IsForwardedYet { get; set; } - } - - public class MMSModel - { - [Key] - public int Id { get; set; } - public int SMSModelId { get; set; } - public SMSModel ParentSMSMessage { get; set; } - public string OriginalMMSData { get; set; } - } - - public class MSTeamsWebHook - { - public int Id { get; set; } - public string WebHookUri { get; set; } - } -} diff --git a/TwilioSMSReceiver/Program.cs b/TwilioSMSReceiver/Program.cs index 2136acd..53271b8 100644 --- a/TwilioSMSReceiver/Program.cs +++ b/TwilioSMSReceiver/Program.cs @@ -1,6 +1,7 @@ using Microsoft.EntityFrameworkCore; using TwilioSMSReceiver; using TwilioSMSReceiver.Interfaces; +using TwilioSMSReceiver.Data; var builder = WebApplication.CreateBuilder(args); diff --git a/TwilioSMSReceiver/SMSDbCtx.cs b/TwilioSMSReceiver/SMSDbCtx.cs deleted file mode 100644 index bf722d3..0000000 --- a/TwilioSMSReceiver/SMSDbCtx.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using TwilioSMSReceiver.Models; - -namespace TwilioSMSReceiver -{ - public class SMSDbCtx : DbContext - { - public SMSDbCtx(DbContextOptions options) : base(options) - { - } - - public DbSet SMSMessages { get;set; } - public DbSet MMSMessages { get;set; } - public DbSet MSTeamsWebHooks { get;set; } - } -} diff --git a/TwilioSMSReceiver/TwilioSMSReceiver.csproj b/TwilioSMSReceiver/TwilioSMSReceiver.csproj index 294efa1..4307b43 100644 --- a/TwilioSMSReceiver/TwilioSMSReceiver.csproj +++ b/TwilioSMSReceiver/TwilioSMSReceiver.csproj @@ -24,4 +24,12 @@ + + + + + + + +