initial commit
This commit is contained in:
24
CityInfo.API/Entities/City.cs
Normal file
24
CityInfo.API/Entities/City.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace CityInfo.API.Entities
|
||||
{
|
||||
public class City
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int Id { get; set; }
|
||||
[Required]
|
||||
[MaxLength(50)]
|
||||
public string Name { get; set; }
|
||||
[MaxLength(200)]
|
||||
public string? Description { get; set; }
|
||||
public ICollection<PointOfInterest> PointsOfInterest { get; set; } = new List<PointOfInterest>();
|
||||
|
||||
public City(string name)
|
||||
{
|
||||
Name = name;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user