generated from admin/template
24 lines
653 B
C#
24 lines
653 B
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace PokedexApi.Data.Models;
|
|
[Table("pokemon")]
|
|
[Index(nameof(Name), IsUnique = true)]
|
|
public class Pokemon
|
|
{
|
|
[Key]
|
|
[Column("pokemon_id")]
|
|
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
|
public int Id { get; set; }
|
|
[Column("pokemon_name")]
|
|
[Required]
|
|
[MaxLength(30)]
|
|
public string Name { get; set; }
|
|
[Column("pokemon_height_m")]
|
|
[Required]
|
|
public double Height { get; set; }
|
|
[Column("pokemon_weight_kg")]
|
|
[Required]
|
|
public double Weight { get; set; }
|
|
} |