question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Easy column overrides

See original GitHub issue

It should be easy to override column scaffolding, for example for enum columns.

Instead it’s such a hassle that I gave up. There are some hints in issue 572, but this is not enough information for a ‘user’.

Without this feature this tools has no real value over the Microsoft tools, at least not for me.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:17 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
wijnsemacommented, Aug 19, 2022

Wow Eric! I tried this out and it works really well!

Thanks quick replies!

This T4 is a great contribution, for me and for everyone I think.

1reaction
ErikEJcommented, Jul 25, 2023

To replace int values with enum types you can modify EntityType.t4 like this:

Add on line 22:

    var enumList = new List<(string EntityTypeName, string PropertyName, string? EnumType)>();
    // add your enums here:
    //enumList.Add( ("Customer", "Rating", "Rating") );

Then on line 107 add/update as follows:

        var enumTuple = enumList.SingleOrDefault(t => t.EntityTypeName == EntityType.Name && t.PropertyName == property.Name);
        var needsInitializer = Options.UseNullableReferenceTypes && !property.IsNullable && !property.ClrType.IsValueType && enumTuple.EnumType == null;

        var propertyType = enumTuple.EnumType ?? code.Reference(property.ClrType);
#>
    public <#= propertyType #><#= needsNullable ? "?" : "" #> <#= property.Name #> { get; set; }<#= needsInitializer ? " = null!;" : "" #>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Override Column Design Best Practice - sql
I have the following tables: dbo.Order ID SourceLinkID OverrideQueueID dbo.SourceLink ID SourceInputID SourceOutputID dbo.
Read more >
Hibernate Tips: How to override column mappings of a ...
Solution: Overriding an attribute mapping for a @MappedSuperclass mapping is relatively simple. You can do it in the same way as you override...
Read more >
Override Display Column Setting - Coda Maker Community
Wondering if it would be possible to override a table's defined display column within subsequent views? :thinking: Two simple ...
Read more >
Override column formula for a cell
I have a sheet with a total column that I have a column formula set in. I would like to sum the total...
Read more >
2 column table but adding a product overrides the other ...
However, adding a product from one column, and then from the other- they are overriding each other- so basically only one product can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found