Reference the project to the newly created db context
This commit is contained in:
parent
7cd388c85b
commit
41cecd32a0
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#nullable disable
|
||||
using TwilioSMSReceiver.Models;
|
||||
using TwilioSMSReceiver.Data;
|
||||
using TwilioSMSReceiver.Data.Models;
|
||||
|
||||
namespace TwilioSMSReceiver.Interfaces
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using TwilioSMSReceiver.Models;
|
||||
using TwilioSMSReceiver.Data.Models;
|
||||
|
||||
namespace TwilioSMSReceiver.Interfaces
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using TwilioSMSReceiver.Models;
|
||||
using TwilioSMSReceiver.Data.Models;
|
||||
using TeamsHook.NET;
|
||||
|
||||
namespace TwilioSMSReceiver.Interfaces
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using TwilioSMSReceiver.Models;
|
||||
using TwilioSMSReceiver.Data.Models;
|
||||
|
||||
namespace TwilioSMSReceiver.Interfaces
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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<MMSModel> 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; }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using TwilioSMSReceiver;
|
||||
using TwilioSMSReceiver.Interfaces;
|
||||
using TwilioSMSReceiver.Data;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using TwilioSMSReceiver.Models;
|
||||
|
||||
namespace TwilioSMSReceiver
|
||||
{
|
||||
public class SMSDbCtx : DbContext
|
||||
{
|
||||
public SMSDbCtx(DbContextOptions options) : base(options)
|
||||
{
|
||||
}
|
||||
|
||||
public DbSet<SMSModel> SMSMessages { get;set; }
|
||||
public DbSet<MMSModel> MMSMessages { get;set; }
|
||||
public DbSet<MSTeamsWebHook> MSTeamsWebHooks { get;set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -24,4 +24,12 @@
|
|||
<PackageReference Include="Twilio.AspNet.Common" Version="5.68.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Models\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\TwilioSMSReceiver.Data\TwilioSMSReceiver.Data.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
Loading…
Reference in New Issue