Copy from old Repository

This commit is contained in:
Santhosh S
2023-08-15 23:52:30 -04:00
parent 93ef278429
commit 4160c2300b
160 changed files with 8796 additions and 19 deletions

View File

@ -0,0 +1,23 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DamageAssesment.Api.Locations.Db
{
public class Location
{
[Key]
[StringLength(4)]
public string Id { get; set; }
[StringLength(50)]
public string Name { get; set; }
[StringLength(1)]
public string MaintenanceCenter { get; set; }
[StringLength(2)]
public string SchoolType { get; set; }
[ForeignKey("Region")]
public string RegionId { get; set; }
}
}

View File

@ -0,0 +1,14 @@
using Microsoft.EntityFrameworkCore;
namespace DamageAssesment.Api.Locations.Db
{
public class LocationDbContext:DbContext
{
public DbSet<Db.Location> Locations { get; set; }
public DbSet<Db.Region> Regions { get; set; }
public LocationDbContext(DbContextOptions options) : base(options)
{
}
}
}

View File

@ -0,0 +1,19 @@
using System.ComponentModel.DataAnnotations;
namespace DamageAssesment.Api.Locations.Db
{
public class Region
{
[Key]
[StringLength(2)]
public string Id { get; set; }
[StringLength(50)]
public string Name { get; set; }
[StringLength(5)]
public string Abbreviation { get; set; }
// public ICollection<Location> Locations { get; set; }
}
}