Skip to content
This repository was archived by the owner on Oct 11, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using Microsoft.EntityFrameworkCore.Migrations;

namespace VirtoCommerce.CartModule.Data.Migrations
{
public partial class AddCartSupportSoftDeletion : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsDeleted",
table: "Cart",
nullable: false,
defaultValue: false);
}

protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsDeleted",
table: "Cart");
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <auto-generated />
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
Expand Down Expand Up @@ -621,6 +621,8 @@ protected override void BuildModel(ModelBuilder modelBuilder)

b.Property<bool>("IsAnonymous");

b.Property<bool>("IsDeleted");

b.Property<bool>("IsRecuring");

b.Property<string>("LanguageCode")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace VirtoCommerce.CartModule.Data.Model
{
public class ShoppingCartEntity : AuditableEntity
public class ShoppingCartEntity : AuditableEntity, ISupportSoftDeletion
{
[StringLength(64)]
public string Name { get; set; }
Expand Down Expand Up @@ -106,6 +106,8 @@ public class ShoppingCartEntity : AuditableEntity
[StringLength(64)]
public string Type { get; set; }

public bool IsDeleted { get; set; }

#region NavigationProperties

public virtual ObservableCollection<DiscountEntity> Discounts { get; set; } = new NullCollection<DiscountEntity>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using EntityFrameworkCore.Triggers;
using Microsoft.EntityFrameworkCore;
using VirtoCommerce.CartModule.Data.Model;
using VirtoCommerce.Platform.Data.Infrastructure;

namespace VirtoCommerce.CartModule.Data.Repositories
{
public class CartDbContext : DbContextWithTriggers
public class CartDbContext : DbContextWithTriggersAndQueryFiltersBase
{
public CartDbContext(DbContextOptions<CartDbContext> options)
: base(options)
Expand Down
Loading