38 lines
1.0 KiB
C#
38 lines
1.0 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using System.Text.Json.Serialization;
|
|
using AyCode.Interfaces.Entities;
|
|
using AyCode.Interfaces.TimeStampInfo;
|
|
using TIAM.Entities.Products;
|
|
|
|
namespace TIAM.Entities.Users;
|
|
|
|
[Table("UserProductMapping")]
|
|
public class UserProductMapping : IEntityGuid, ITimeStampInfo
|
|
{
|
|
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
|
public Guid Id { get; set; }
|
|
public Guid UserId { get; set; }
|
|
public Guid ProductId { get; set; }
|
|
|
|
[JsonIgnore]
|
|
public virtual User User { get; set; }
|
|
[JsonIgnore]
|
|
public virtual Product Product { get; set; }
|
|
|
|
public DateTime Created { get; set; }
|
|
public DateTime Modified { get; set; }
|
|
|
|
public UserProductMapping()
|
|
{ }
|
|
|
|
public UserProductMapping(Guid userId, Guid productId) : this(Guid.NewGuid(), userId, productId)
|
|
{ }
|
|
|
|
public UserProductMapping(Guid id, Guid userId, Guid productId)
|
|
{
|
|
Id = id;
|
|
UserId = userId;
|
|
ProductId = productId;
|
|
}
|
|
} |