ποΈCustomizing Database
Things you can do to customize the database
Using a custom table name
[Api("/people", ApiMethodsToGenerate.All)]
[Table("MyFancyNewTableName")]
public class Person : IObjectBase<Guid> {
}Full customization
[Api("/people", ApiMethodsToGenerate.All)]
public class Person : IObjectBase<Guid>, IEntityTypeConfiguration<Person>
{
public Guid Id { get; set; } = new Guid();
public string Name { get; set; }
// Set custom stuff as desired similar to DBContext model builder
// All model building options are available
public void Configure(EntityTypeBuilder<Person> builder)
{
builder.ToTable("TableName");
builder.HasMany("relatedObject");
...
}
}Last updated