Skip to content
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

Proposals: Add Ignore columns, Include columns, Read-only mode. #708

Closed
Lechus opened this issue Jan 14, 2021 · 15 comments
Closed

Proposals: Add Ignore columns, Include columns, Read-only mode. #708

Lechus opened this issue Jan 14, 2021 · 15 comments
Labels
enhancement New feature or request reveng

Comments

@Lechus
Copy link

Lechus commented Jan 14, 2021

  1. I do not see an option that says something like: Exclude these columns (by a name) from all tables/views when generating code.
    Need to do it manually at the moment.

So got a property like:
entity.Property(e => e.MsreplTranVersion)
.HasDefaultValueSql("(newid())")
.HasComment("REPLICATION COLUMN");

  1. Add option to not EXCLUDE columns, but to INCLUDE? So that will generate only required columns.

  2. Add option generate Read-only mode?
    That will not add unnecessary properties and settings, and could add NoTracking things, etc.?

Steps to reproduce

Click to reverse db, EF 5 mode;

Further technical details

EF Core Power Tools version: 2.5.454.0.

Database engine: SQL Server

Visual Studio version: Visual Studio 2019 16.8.1

@Lechus Lechus changed the title Proposals: Add Ignore columns, Include columns, Read-only mode. Proposals: Add Ignore columns, Include columns, Read-only mode and ignore unused namespaces. Jan 14, 2021
@Lechus Lechus changed the title Proposals: Add Ignore columns, Include columns, Read-only mode and ignore unused namespaces. Proposals: Add Ignore columns, Include columns, Read-only mode. Jan 14, 2021
@ErikEJ
Copy link
Owner

ErikEJ commented Jan 14, 2021

Thanks!
re 1: You could create a tool to do this (to manipulate the efpt.config.json file).

If there was a GUI option, how would that look?

re 3: see dotnet/efcore#7586

@ErikEJ ErikEJ added enhancement New feature or request reveng labels Jan 21, 2021
@ErikEJ ErikEJ added this to the Backlog milestone Jan 29, 2021
@sm15455
Copy link
Collaborator

sm15455 commented Feb 13, 2021

@ErikEJ I was thinking about point 1 and 2. Maybe we could improve search and selection in the objects page.
We could expand search capabilities enabling the user to search by multiple strings by dividing words using a special char (maybe a comma). For instance, if I want to search orderid and customerid, I could enter "orderid, customerid". We could also add options to enable user to select the search type (starts with, equals, ends with, include, exclude, threat string as regex).
As for selection capabilities, so far, when the user select a node with children, the selection/deselection is reflected on all children (visible or not). We could improve selection to let it work on visible objects only (of course the user should enable such options).
The problem I see with this improvements is that UI would get a bit more complicated.
Any thought?

@ErikEJ
Copy link
Owner

ErikEJ commented Feb 13, 2021

I would like to see more votes for this, but some sort of simple filtering capability would probably fit the bill.

@sm15455
Copy link
Collaborator

sm15455 commented Feb 14, 2021

I'll try to create something and will show you the result.

@ErikEJ
Copy link
Owner

ErikEJ commented Feb 14, 2021

Sounds great!

@sm15455
Copy link
Collaborator

sm15455 commented Feb 15, 2021

The image is self explanatory. The regular expression mode should cover all advanced search needs.

image

@ErikEJ
Copy link
Owner

ErikEJ commented Feb 16, 2021

Simple and elegant - and should cover both 1 and 2 here @Lechus

@ErikEJ
Copy link
Owner

ErikEJ commented Feb 17, 2021

Read Only should be possible to implement by adding HasNoKey in the OnModelCreatingPartial implementation in a partial DbContext class. https://docs.microsoft.com/en-us/ef/core/modeling/keyless-entity-types?tabs=data-annotations#keyless-entity-types-characteristics

@ErikEJ ErikEJ closed this as completed Feb 17, 2021
@ErikEJ
Copy link
Owner

ErikEJ commented Feb 17, 2021

image

@sm15455 Is this by design?

@sm15455
Copy link
Collaborator

sm15455 commented Feb 17, 2021

Definitely not... but here's how I see it.
image

Maybe something about resolution?

@ErikEJ
Copy link
Owner

ErikEJ commented Feb 17, 2021

Yes, I have large fonts/zoom enabled.

@sm15455
Copy link
Collaborator

sm15455 commented Feb 17, 2021

In the PickTablesDialog.xaml file at line 133, try changing this

            <Popup x:Name="ContextPopup" 
                   PlacementTarget="{Binding ElementName=MainButton}" 
                   Placement="Left" 
                   VerticalOffset="{Binding ActualHeight, ElementName=MainButton}" 
                   HorizontalOffset="{Binding ActualWidth, ElementName=MainButton}" 
                   StaysOpen="False">

with this

            <Popup x:Name="ContextPopup" 
                   PlacementTarget="{Binding ElementName=MainButton}" 
                   Placement="Bottom" 
                   StaysOpen="False">

Should become this.
image

@ErikEJ
Copy link
Owner

ErikEJ commented Feb 18, 2021

@sm15455 Yes, that fixed it for me.

@ErikEJ
Copy link
Owner

ErikEJ commented Feb 18, 2021

@sm15455 Should I change to this in master branch?

@sm15455
Copy link
Collaborator

sm15455 commented Feb 18, 2021

It's ok for me.

@ErikEJ ErikEJ removed this from the Backlog milestone Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request reveng
Projects
None yet
Development

No branches or pull requests

3 participants