mirror of
https://github.com/SoDOff-Project/sodoff.git
synced 2025-11-27 10:06:53 -08:00
* update items and dragons id on import * check for viking name unique * add unique constraints in database * add simple import/export html form for localhosted srvers
30 lines
779 B
C#
30 lines
779 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace sodoff.Model;
|
|
|
|
[Index(nameof(EntityId), IsUnique = true)]
|
|
public class Dragon {
|
|
[Key]
|
|
// [JsonIgnore] used in serialised xml (stables)
|
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
|
public int Id { get; set; }
|
|
|
|
[Required]
|
|
public Guid EntityId { get; set; }
|
|
|
|
[Required]
|
|
[JsonIgnore]
|
|
public int VikingId { get; set; }
|
|
|
|
public string? RaisedPetData { get; set; }
|
|
|
|
public int? PetXP { get; set; }
|
|
|
|
[JsonIgnore]
|
|
public virtual Viking Viking { get; set; } = null!;
|
|
public virtual ICollection<PairData> PairData { get; set; } = null!;
|
|
}
|