migration
This commit is contained in:
22
Webshop.Domain/Entities/Cart.cs
Normal file
22
Webshop.Domain/Entities/Cart.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Webshop.Domain.Entities
|
||||
{
|
||||
public class Cart
|
||||
{
|
||||
[Key]
|
||||
public Guid Id { get; set; }
|
||||
|
||||
// Verknüpfung zum User (String, da Identity User Id ein String ist)
|
||||
public string? UserId { get; set; }
|
||||
|
||||
// Falls du auch Gast-Warenkörbe ohne Login unterstützt:
|
||||
public string? SessionId { get; set; }
|
||||
|
||||
public DateTime LastModified { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public virtual ICollection<CartItem> Items { get; set; } = new List<CartItem>();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user