File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed
generators/entity-server/templates/dotnetcore/src/Project.Domain/Entities Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -71,25 +71,17 @@ namespace <%= namespace %>.Domain.Entities
7171 const otherEntityNamePascalized = relationships[idx].otherEntityNamePascalized ;
7272 const relationshipFieldNamePascalizedPlural = relationships[idx].relationshipFieldNamePascalizedPlural ;
7373 const relationshipFieldNamePascalized = relationships[idx].relationshipFieldNamePascalized ;
74- if (relationshipType === ' one-to-one' ) {
75- if (otherEntityNamePascalized === ' User' ) { _% >
76- public string UserId { get; set; }
77- < % _ } else { _% >
74+ if (relationshipType === ' one-to-one' ) { _% >
7875 public < %= primaryKeyType _% > < % _ if (primaryKeyType !== ' string' ) { _% > ? < % _ } % > < %= relationshipFieldNamePascalized % > Id { get; set; }
79- < % _ } _% >
8076 public < %= otherEntityNamePascalized % > < %= relationshipFieldNamePascalized % > { get; set; }
8177< % _ }
8278 if (relationshipType === ' one-to-many' ) { _% >
8379 public IList<< %= otherEntityNamePascalized % >> < %= relationshipFieldNamePascalizedPlural % > { get; set; } = new List << %= otherEntityNamePascalized % >> ();
8480 < % _ } else if (relationshipType === ' many-to-one' ) {
8581 if (relationshipRequired) { _% >
8682 [Required]
87- < % _ }
88- if (otherEntityNamePascalized === ' User' ) { _% >
89- public string UserId { get; set; }
90- < % _ } else { _% >
91- public < %= primaryKeyType _% > < % _ if (primaryKeyType !== ' string' ) { _% > ? < % _ } % > < %= relationshipFieldNamePascalized % > Id { get; set; }
9283 < % _ } _% >
84+ public < %= primaryKeyType _% > < % _ if (primaryKeyType !== ' string' ) { _% > ? < % _ } % > < %= relationshipFieldNamePascalized % > Id { get; set; }
9385 public < %= otherEntityNamePascalized % > < %= relationshipFieldNamePascalized % > { get; set; }
9486< % } else if (relationshipType === ' many-to-many' ) {
9587 const ownerSide = relationships[idx].ownerSide ; _% >
You can’t perform that action at this time.
0 commit comments