-
Notifications
You must be signed in to change notification settings - Fork 54
Changes to Support Schema Foldering, And Nullable EF Core Project #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ng propertyTransformer: (epi) => new EntityFrameworkCore.Scaffolding.Handlebars.EntityPropertyInfo(epi.PropertyType + (epi.PropertyIsNullable == true && !epi.PropertyType.Contains("?") ? "?" :"") , epi.PropertyName, epi.PropertyIsNullable)
|
@tonysneed Any feedback? |
|
@johngold-onshift The way I think we want to approach adding support for nullable reference types is to add an public void ConfigureDesignTimeServices(IServiceCollection services)
{
services.AddHandlebarsScaffolding(options =>
{
options.EnableNullableReferenceTypes = true;
});
}Then in Metadata will need to be added, so that the Properties.hbs template can be modified to set defaults for non-nullable properties and generate output that uses the null forgiving operator. public partial class Customer
{
public string CompanyName { get; set; } = default!;
}Would you be able to create a new PR that takes this approach? |
|
For schema foldering support, would you create another issue and a separate PR? Thanks! |
|
@JohnGoldInc Do you plan to open another PR to implement the approach I suggested? |
|
Yes, just got distracted today :)
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: Anthony Sneed <notifications@github.com>
Sent: Tuesday, April 28, 2020 5:46:06 PM
To: TrackableEntities/EntityFrameworkCore.Scaffolding.Handlebars <EntityFrameworkCore.Scaffolding.Handlebars@noreply.github.com>
Cc: John Gold <jgold@onshift.com>; Mention <mention@noreply.github.com>
Subject: Re: [TrackableEntities/EntityFrameworkCore.Scaffolding.Handlebars] Changes to Support Schema Foldering, And Nullable EF Core Project (#99)
@JohnGoldInc<https://github.com/JohnGoldInc> Do you plan to open another PR to implement the approach I suggested?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#99 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AOO3LNUNMZ2I7Z6MJJHQYGLRO5FB5ANCNFSM4KPK5BHA>.
|
|
@JohnGoldInc Be sure to create a new branch from the latest commit on my master branch (5b2d3d2). Use this branch for your new PR. For some guidance on creating the PR, please refer to the Contributing Guidelines. |
|
@tonysneed For EnableNullableReferenceTypes ; do you want me to check in changes to sample project ? (where I am testing it) |
|
Yes I think that is a good idea to check in changes to the sample project. That way, I can also run it on my side to see if I get the same behavior. |
|
@tonysneed I deleted CodeTemplates folder to let it regenerate; I see it would want to remove things like: I assume you would want me to put that back? |
|
Oh yes, don't delete the templates. Better if you could just update them. |
Changes to Support Schema Foldering, And Nullable EF Core Project Using propertyTransformer: (epi) => new EntityFrameworkCore.Scaffolding.Handlebars.EntityPropertyInfo(epi.PropertyType + (epi.PropertyIsNullable == true && !epi.PropertyType.Contains("?") ? "?" :"") , epi.PropertyName, epi.PropertyIsNullable)