* Removed Unused Using and Reorganized the Using * Removed unused using, Reorganized using, moved the class to separate file, removed commented code in Catalog.API * Revert "Removed unused using, Reorganized using, moved the class to separate file, removed commented code in Catalog.API" This reverts commit 34241c430619b3b0bbeaabafa44c078c859237c4. * Removed unused using and reorganized the using inside "Services" folder * Removed Unused using and reoganized the using * Refactor Webhooks.API * Removed unused using and reorganized using inside Catalog.API
27 lines
855 B
C#
27 lines
855 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Design;
|
|
using Webhooks.API.Model;
|
|
|
|
namespace Webhooks.API.Infrastructure
|
|
{
|
|
public class WebhooksContext : DbContext
|
|
{
|
|
|
|
public WebhooksContext(DbContextOptions<WebhooksContext> options) : base(options)
|
|
{
|
|
}
|
|
public DbSet<WebhookSubscription> Subscriptions { get; set; }
|
|
}
|
|
|
|
public class WebhooksContextDesignFactory : IDesignTimeDbContextFactory<WebhooksContext>
|
|
{
|
|
public WebhooksContext CreateDbContext(string[] args)
|
|
{
|
|
var optionsBuilder = new DbContextOptionsBuilder<WebhooksContext>()
|
|
.UseSqlServer("Server=.;Initial Catalog=Microsoft.eShopOnContainers.Services.CatalogDb;Integrated Security=true");
|
|
|
|
return new WebhooksContext(optionsBuilder.Options);
|
|
}
|
|
}
|
|
}
|