Skip to content

Conversation

@dmayhak
Copy link
Contributor

@dmayhak dmayhak commented Mar 15, 2020

No description provided.

Copy link
Contributor

@tonysneed tonysneed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After making these two changes, please squash your commits into one, then force push the commit to your branch.

After this I will merge your PR. Thanks!

canUseDataAnnotations = false;
lines.Add(
$".{nameof(ReferenceReferenceBuilder.HasPrincipalKey)}"
+ (foreignKey.IsUnique ? $"<{((ITypeBase)foreignKey.PrincipalEntityType).DisplayName()}>" : "")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 812 should be:

+ (foreignKey.IsUnique ? $"<{EntityTypeTransformationService.TransformPropertyName(((ITypeBase)foreignKey.PrincipalEntityType).DisplayName())}>" : "")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dmayhak You still need to make this change, so that generic type arguments are transformed.


lines.Add(
$".{nameof(ReferenceReferenceBuilder.HasForeignKey)}"
+ (foreignKey.IsUnique ? $"<{((ITypeBase)foreignKey.DeclaringEntityType).DisplayName()}>" : "")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 818 should be:

+ (foreignKey.IsUnique ? $"<{EntityTypeTransformationService.TransformPropertyName(((ITypeBase)foreignKey.DeclaringEntityType).DisplayName())}>" : "")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dmayhak You still need to make this change, so that generic type arguments are transformed.

@tonysneed tonysneed added enhancement New feature or request bug Something isn't working and removed enhancement New feature or request labels Apr 25, 2020
@tonysneed
Copy link
Contributor

@dmayhak Would you be able to make the requested changes?

@codingdna2
Copy link
Contributor

I guess similar modifications are required in HbsCSharpEntityTypeGenerator.

@codingdna2
Copy link
Contributor

codingdna2 commented May 5, 2020

I found an additional issue with the usage of TransformNavPropertyName and TransformPropertyName. See commit 3e16d8f and 15ce17f. It was quite hard to fix for me, so maybe a double check is needed

@codingdna2
Copy link
Contributor

@tonysneed Please check the above. Thanks!

@tonysneed
Copy link
Contributor

If you run the ScaffoldingSample, with Add optional Handlebars transformers uncommented, then you'll see this in OnModelCreating in NorthwindSlimContext:

entity.HasOne(d => d.CustomerFoo)
    .WithOne(p => p.CustomerSettingFoo)
    .HasForeignKey<CustomerSetting>(d => d.CustomerIdFoo)
    .OnDelete(DeleteBehavior.ClientSetNull)
    .HasConstraintName("FK_CustomerSetting_Customer");

Should be CustomerSettingFoo. This will be corrected if you make the changes I requested above.

Aside from this, everything else looks good, as far as I can tell.

@tonysneed
Copy link
Contributor

Let me know when you have made these changes, then we can talk about how to prepare your PR for merging.

@codingdna2
Copy link
Contributor

I think I did in this commit 4906c14

@codingdna2
Copy link
Contributor

I’ll run the tests you suggested tomorrow! Thanks for your support!

@tonysneed
Copy link
Contributor

tonysneed commented May 5, 2020

@codingdna2 I don't see your recent commits (4906c14, 3e16d8f) on this PR branch, which is 'master' in fork by @dmayhak. Can you point me to the branch where you pushed you recent commits?

Perhaps you could create a separate PR for your branch? Please see the Contributing Guidelines.

@tonysneed
Copy link
Contributor

Covered by #118.

@tonysneed tonysneed closed this May 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants