Add models for BaseDomainModel, Coach and Team.

This commit is contained in:
Kevin Matsubara 2025-04-04 15:41:45 +02:00
parent 62ae17f271
commit 5e688a24d5
4 changed files with 21 additions and 6 deletions

View File

@ -0,0 +1,6 @@
namespace EntityFrameworkCore.Domain;
// Since C#11, you do not need to wrap in accolades anymore.
public abstract class BaseDomainModel
{
public DateTime CreatedDate { get; set;}
}

View File

@ -1,6 +0,0 @@
namespace EntityFrameworkCore.Domain;
public class Class1
{
}

View File

@ -0,0 +1,8 @@
namespace EntityFrameworkCore.Domain;
// Since C#11, you do not need to wrap in accolades anymore.
public class Coach : BaseDomainModel
{
public int Id { get; set; } // Anything called "Id" is automatically a Primary Key.
public string Name { get; set; } // Strings are automatically become VARCHAR database types.
}

View File

@ -0,0 +1,7 @@
namespace EntityFrameworkCore.Domain;
// Since C#11, you do not need to wrap in accolades anymore.
public class Team : BaseDomainModel
{
public int TeamId { get; set;} // This naming convention also allows EF to see this as a PK.
public string? Name { get; set; }
}