Translate {IPAddress,NetworkAddress}.Parse()
See original GitHub issue@austindrenski, in addition to all the great translations you’ve recently added, I think we’re missing one: IPAddress.Parse()
, which is basically the way to specify an IP address literal…
This should be pretty easy, feel like doing it?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Google Translate
Google's service, offered free of charge, instantly translates words, phrases, and web pages between English and over 100 other languages.
Read more >IPAddress.Parse Method (System.Net)
Converts an IP address string to an IPAddress instance.
Read more >Translation | Django documentation
Specify a translation string by using the function gettext() . ... to contain the comma so that the filter parsing code knows how...
Read more >Method: translate
Translates input text, returning translated text. HTTP request. POST https://translation.googleapis.com/language/translate/v2.
Read more >ngx-translate/core: The internationalization (i18n) library for ...
This method allows you to configure the TranslateModule by specifying a loader, a parser and/or a missing translations handler. import {BrowserModule} from '@ ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
NpgsqlEvaluatableExpressionFilter
is only meant to specify methods that should not be evaluated on the client, ever. This is a way to avoid evaluating things likeDateTime.Now
client-side (because time zones may be different), or creating a new GUID client-side (which EF Core would reuse across different database rows, rather than generating a GUID per-row). If you’re interested in reading more about this, see the discussion in https://github.com/aspnet/EntityFrameworkCore/issues/12552#issuecomment-405704458 (including possible upcoming changes).For our purposes… if the expression contains
IPAddress.Parse("127.0.0.1")
(with a constant!), then it does make sense for EF Core to evaluate it locally and send the result as a parameter (this is exactly whatNpgsqlEvaluatableExpressionFilter
is meant to prevent) - there’s no reason to avoid it. The only important bit is to make sure that the parameter really does contain the proper instance ofIPAddress
- it’s not clear from your comments if that’s happening or not.If, however, the expression contains a non-constant (e.g. some text column in the database, or a C# variable), then EF Core cannot do client evaluation as above, and you translator should get invoked as expected. Here are some examples:
So what you’re seeing is probably simply the expected correct behavior, let me know if otherwise.
Ahhh. That all makes sense. I saw some unexpected parameterization and
panickedassumed the worst!What’s interesting (and caught me off-guard) is that both of the following are parameterized:
Much appreciated!