Viswanatha Swamy 716aca6779
1. remove unused using, 2. Reorganized the using, 3. Moved the class into separate file and 4. Added line and spacing formats (#1532)
* 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
2020-12-17 16:20:22 +05:30

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);
}
}
}