-
Notifications
You must be signed in to change notification settings - Fork 0
Dev GuideLine
YEJIA SHI edited this page Nov 20, 2024
·
4 revisions
- copy the newest swagger.json to root directory
- Install generator
npm install @openapitools/openapi-generator-cli -D
- make sure Jave is installed
java -version
- run
npm run generate-api
- replace the basePath in all *.service.ts:
protected basePath: string = environment.apiUrl;
Create entity
public class InscriptionImage
{
public int Id { get; set; }
public int IdInscription { get; set; }
public byte[] ImageData { get; set; }
}
Define entity in dbContext
public DbSet<InscriptionImage> InscriptionImages { get; set; }
modelBuilder.Entity<InscriptionImage>(m =>
{
m.HasKey(x => x.Id);
m.Property(x => x.IdInscription).IsRequired();
m.Property(x => x.ImageData).IsRequired();
});
Launch Package Manager Console
Add-Migration InscriptionImageInitial
Update-Database