TrackableEntities / EntityFrameworkCore.Scaffolding.Handlebars

Scaffold EF Core models using Handlebars templates.
MIT License
209 stars 53 forks source link

Generated entities extends ObservableEntity instead of TrackableEntity #66

Closed omatrot closed 5 years ago

omatrot commented 5 years ago

Unless there is an option to specify that I'm unaware off, the TypeScript template generates entities that extends ObservableEntity.

Shouldn't it generate entities extending TrackableEntity?

tonysneed commented 5 years ago

Are you using TrackableEntities.Core.Templates.TypeScript (and not ObservableEntities.Core.Templates.TypeScript)?

dotnet new -i TrackableEntities.Core.Templates.TypeScript
dotnet new te-templates-typescript

The generated entities should extend TrackableEntity.

import { TrackableEntity } from 'trackable-entities';
import { Product } from './Product';

export class Category extends TrackableEntity {

  categoryId: number;
  categoryName: string;
  product: Product[];

  constructor() {
    super();
    return super.proxify(this);
  }
}
omatrot commented 5 years ago

Sorry, you're right, I used dotnet new oe-template-typescript