Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

Models.twig 954B

1234567891011121314151617181920
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel.DataAnnotations;
  4. using System.ComponentModel.DataAnnotations.Schema;
  5. namespace TestUtils.DataAccess.Models
  6. {
  7. public partial class {{ table.getName() }}
  8. {
  9. {% for column in table.getColumns() %}{% if (column.isSelected()) %}
  10. public {{ column.getType() }}{% if (not (column.isNotNull()) and (column.isTypeNotNull())) %}?{% endif %} {{ column.getName() }} { get; set; }
  11. {% endif %}{% endfor %}
  12. {% for fk in table.getSourceForeignKeys() %}{% if (fk.isSelected()) %}
  13. public virtual {{ fk.getTargetTable().getName() }} {{ fk.getSourceForeignKeyName() }} { get; set; }
  14. {% endif %}{% endfor %}
  15. {% for fk in table.getTargetForeignKeys() %}{% if (fk.isSelected()) %}
  16. public virtual IList<{{ fk.getSourceTable().getName() }}> {{ fk.getTargetForeignKeyName() }} { get; set; }
  17. {% endif %}{% endfor %}
  18. }
  19. }