//-----------------------------------------------------------------------
//
// Copyright (c) lanedirt. All rights reserved.
// Licensed under the AGPLv3 license. See LICENSE.md file in the project root for full license information.
//
//-----------------------------------------------------------------------
namespace AliasClientDb;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using AliasClientDb.Abstracts;
///
/// Login object.
///
public class Credential : SyncableEntity
{
///
/// Gets or sets Login ID.
///
[Key]
public Guid Id { get; set; }
///
/// Gets or sets the identity ID foreign key.
///
public Guid AliasId { get; set; }
///
/// Gets or sets the identity object.
///
[ForeignKey("AliasId")]
public virtual Alias Alias { get; set; } = null!;
///
/// Gets or sets optional notes field.
///
public string? Notes { get; set; }
///
/// Gets or sets the username field.
///
public string? Username { get; set; }
///
/// Gets or sets the password objects.
///
public virtual ICollection Passwords { get; set; } = [];
///
/// Gets or sets the attachment objects.
///
public virtual ICollection Attachments { get; set; } = [];
///
/// Gets or sets the TOTP code objects.
///
public virtual ICollection TotpCodes { get; set; } = [];
///
/// Gets or sets the service ID foreign key.
///
public Guid ServiceId { get; set; }
///
/// Gets or sets the service object.
///
[ForeignKey("ServiceId")]
public virtual Service Service { get; set; } = null!;
}