@ -1 +1 @@ | |||
echo RESTORING ALL PACKAGES...; for f in /src/csproj-files/*.csproj; do dotnet restore $f; done | |||
echo RESTORING ALL PACKAGES...; for f in /src/csproj-files/*.csproj; do dotnet restore $f; done |
@ -0,0 +1,50 @@ | |||
// <auto-generated /> | |||
using System; | |||
using Microsoft.EntityFrameworkCore; | |||
using Microsoft.EntityFrameworkCore.Infrastructure; | |||
using Microsoft.EntityFrameworkCore.Metadata; | |||
using Microsoft.EntityFrameworkCore.Migrations; | |||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; | |||
using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF; | |||
namespace Catalog.API.Infrastructure.IntegrationEventMigrations | |||
{ | |||
[DbContext(typeof(IntegrationEventLogContext))] | |||
[Migration("20190507184807_AddTransactionId")] | |||
partial class AddTransactionId | |||
{ | |||
protected override void BuildTargetModel(ModelBuilder modelBuilder) | |||
{ | |||
#pragma warning disable 612, 618 | |||
modelBuilder | |||
.HasAnnotation("ProductVersion", "2.2.3-servicing-35854") | |||
.HasAnnotation("Relational:MaxIdentifierLength", 128) | |||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); | |||
modelBuilder.Entity("Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.IntegrationEventLogEntry", b => | |||
{ | |||
b.Property<Guid>("EventId") | |||
.ValueGeneratedOnAdd(); | |||
b.Property<string>("Content") | |||
.IsRequired(); | |||
b.Property<DateTime>("CreationTime"); | |||
b.Property<string>("EventTypeName") | |||
.IsRequired(); | |||
b.Property<int>("State"); | |||
b.Property<int>("TimesSent"); | |||
b.Property<string>("TransactionId"); | |||
b.HasKey("EventId"); | |||
b.ToTable("IntegrationEventLog"); | |||
}); | |||
#pragma warning restore 612, 618 | |||
} | |||
} | |||
} |
@ -0,0 +1,22 @@ | |||
using Microsoft.EntityFrameworkCore.Migrations; | |||
namespace Catalog.API.Infrastructure.IntegrationEventMigrations | |||
{ | |||
public partial class AddTransactionId : Migration | |||
{ | |||
protected override void Up(MigrationBuilder migrationBuilder) | |||
{ | |||
migrationBuilder.AddColumn<string>( | |||
name: "TransactionId", | |||
table: "IntegrationEventLog", | |||
nullable: true); | |||
} | |||
protected override void Down(MigrationBuilder migrationBuilder) | |||
{ | |||
migrationBuilder.DropColumn( | |||
name: "TransactionId", | |||
table: "IntegrationEventLog"); | |||
} | |||
} | |||
} |
@ -0,0 +1,18 @@ | |||
using Microsoft.EntityFrameworkCore; | |||
using Microsoft.EntityFrameworkCore.Design; | |||
using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF; | |||
namespace Catalog.API.Infrastructure.IntegrationEventMigrations | |||
{ | |||
public class IntegrationEventLogContextDesignTimeFactory : IDesignTimeDbContextFactory<IntegrationEventLogContext> | |||
{ | |||
public IntegrationEventLogContext CreateDbContext(string[] args) | |||
{ | |||
var optionsBuilder = new DbContextOptionsBuilder<IntegrationEventLogContext>(); | |||
optionsBuilder.UseSqlServer(".", options => options.MigrationsAssembly(GetType().Assembly.GetName().Name)); | |||
return new IntegrationEventLogContext(optionsBuilder.Options); | |||
} | |||
} | |||
} |
@ -1,11 +1,12 @@ | |||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; | |||
using System; | |||
using System.Threading.Tasks; | |||
namespace Ordering.API.Application.IntegrationEvents | |||
{ | |||
public interface IOrderingIntegrationEventService | |||
{ | |||
Task PublishEventsThroughEventBusAsync(); | |||
Task PublishEventsThroughEventBusAsync(Guid transactionId); | |||
Task AddAndSaveEventAsync(IntegrationEvent evt); | |||
} | |||
} |
@ -0,0 +1,50 @@ | |||
// <auto-generated /> | |||
using System; | |||
using Microsoft.EntityFrameworkCore; | |||
using Microsoft.EntityFrameworkCore.Infrastructure; | |||
using Microsoft.EntityFrameworkCore.Metadata; | |||
using Microsoft.EntityFrameworkCore.Migrations; | |||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; | |||
using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF; | |||
namespace Ordering.API.Infrastructure.IntegrationEventMigrations | |||
{ | |||
[DbContext(typeof(IntegrationEventLogContext))] | |||
[Migration("20190507185219_AddTransactionId")] | |||
partial class AddTransactionId | |||
{ | |||
protected override void BuildTargetModel(ModelBuilder modelBuilder) | |||
{ | |||
#pragma warning disable 612, 618 | |||
modelBuilder | |||
.HasAnnotation("ProductVersion", "2.2.3-servicing-35854") | |||
.HasAnnotation("Relational:MaxIdentifierLength", 128) | |||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); | |||
modelBuilder.Entity("Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.IntegrationEventLogEntry", b => | |||
{ | |||
b.Property<Guid>("EventId") | |||
.ValueGeneratedOnAdd(); | |||
b.Property<string>("Content") | |||
.IsRequired(); | |||
b.Property<DateTime>("CreationTime"); | |||
b.Property<string>("EventTypeName") | |||
.IsRequired(); | |||
b.Property<int>("State"); | |||
b.Property<int>("TimesSent"); | |||
b.Property<string>("TransactionId"); | |||
b.HasKey("EventId"); | |||
b.ToTable("IntegrationEventLog"); | |||
}); | |||
#pragma warning restore 612, 618 | |||
} | |||
} | |||
} |
@ -0,0 +1,22 @@ | |||
using Microsoft.EntityFrameworkCore.Migrations; | |||
namespace Ordering.API.Infrastructure.IntegrationEventMigrations | |||
{ | |||
public partial class AddTransactionId : Migration | |||
{ | |||
protected override void Up(MigrationBuilder migrationBuilder) | |||
{ | |||
migrationBuilder.AddColumn<string>( | |||
name: "TransactionId", | |||
table: "IntegrationEventLog", | |||
nullable: true); | |||
} | |||
protected override void Down(MigrationBuilder migrationBuilder) | |||
{ | |||
migrationBuilder.DropColumn( | |||
name: "TransactionId", | |||
table: "IntegrationEventLog"); | |||
} | |||
} | |||
} |
@ -0,0 +1,18 @@ | |||
using Microsoft.EntityFrameworkCore; | |||
using Microsoft.EntityFrameworkCore.Design; | |||
using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF; | |||
namespace Catalog.API.Infrastructure.IntegrationEventMigrations | |||
{ | |||
public class IntegrationEventLogContextDesignTimeFactory : IDesignTimeDbContextFactory<IntegrationEventLogContext> | |||
{ | |||
public IntegrationEventLogContext CreateDbContext(string[] args) | |||
{ | |||
var optionsBuilder = new DbContextOptionsBuilder<IntegrationEventLogContext>(); | |||
optionsBuilder.UseSqlServer(".", options => options.MigrationsAssembly(GetType().Assembly.GetName().Name)); | |||
return new IntegrationEventLogContext(optionsBuilder.Options); | |||
} | |||
} | |||
} |