EntityFramework-Reverse-POCO-Code-First-Generator icon indicating copy to clipboard operation
EntityFramework-Reverse-POCO-Code-First-Generator copied to clipboard

What takes precedence RegexExclude or RegexInclude?

Open MarkLFT opened this issue 3 years ago • 2 comments

I am trying to get a single table from a list of many similar named tables, and also excluding related tables that are not needed.

For example, I have around 50 tables called Hotelxxxxxxxxxx, several of these have links to other tables I do require, i.e. PoSInvoice references around five Hotelxxxxx tables, but in this instance, I do not require access to them.

So I created an exclude as follows:

FilterSettings.TableFilters.Add(new RegexExcludeFilter("Hotel.*"));

But I do need one table, so I created then following include.

FilterSettings.TableFilters.Add(new RegexIncludeFilter("HotelFolioItem.*"));

But no matter the order I put them, it does not create the classes for HotelFolioItems.

I really do not want to create 50 rules to exclude each table I don't want, but is that the only way I can do this?

Any advice you can offer would be greatly appreciated.

MarkLFT avatar Jan 13 '22 04:01 MarkLFT

The exclude filter runs first, then the include filter keeps the remainder. So its already too late if exclude filter has rejected any table you need.

sjh37 avatar Jan 13 '22 18:01 sjh37

What about Hotel(?!FolioItem).*

TimSirmovics avatar Jan 13 '22 20:01 TimSirmovics