您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

Models.twig 957B

1234567891011121314151617181920
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel.DataAnnotations;
  4. using System.ComponentModel.DataAnnotations.Schema;
  5. namespace WebApiWebSem.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. }