Best Of
Util.RawHtml and input box
Re: Util.RawHtml and input box
Re: CreateXhtmlWriter with LINQPadChart - wrong output
Change htmlOut.Write(chart)
to htmlOut.Write (chart.ToBitmap())
. (You can also specify a width and height when calling ToBitmap.)
Re: Dumping the Util ProgressBar and the visible property
I apologize for this taking so long. Just letting Joe know that I got the latest version and was able to accomplish what I intended with the progress bar in the scenario I discussed.
Thanks so much for the quick enhancement!
Re: Warning: LINQPad has identified vulnerabilities in NuGet package Azure.Identity. Click for details.
Thanks - this should now be fixed in 8.3.6.
Re: Any way to suppress vulnerability warnings?
If you expand the warning it tells you how to suppress the warning.
Re: LinqPad8 is showing me a cached Entity ?
I'm guessing this is Linq2Sql caching the entity.
There are a number of ways to resolve this.
If you are not going to be calling SubmitChanges() then you can disable the tracker and caching at the start of your query.
this.ObjectTrackingEnabled = false;
Alternatively keep a reference to the customer that will be changed outside LinqPad, and then refresh that record after calling your webservice - e.g.
var customer = Customers.Single(s => s.CustomerIdInDataHost == _oldCustomerID).Dump(); // ASMX webservice that simply replace the customer id for the Entity (same database as used in my Query) _dataHostService.ReplaceCustomerIdInDataHost(_datahostapikey, _owner, _newID, _oldCustomerID); // Refresh the customer record this.Refresh(System.Data.Linq.RefreshMode.OverwriteCurrentValues, customer ); // Show the updated Customer with the new ID Customers.Single(s => s.CustomerIdInDataHost == _newID).Dump();
Alternatively you can create a new DataContext. Unfortunately you can do re-assign the new context to this
, but you can something like
var dc = new TypedDataContext(this.Connection.ConnectionString); dc.Customers.Single(s => s.CustomerIdInDataHost == _newID).Dump();
That is kinda dangerous as it is very easy to forget to prefix your query with dc.
Finally, Linq has a method to clear the cache but unfortunately it is marked as private, but you can if you use Uncapsulate, e.g.
var customer = Customers.Single(s => s.CustomerIdInDataHost == _oldCustomerID).Dump(); // ASMX webservice that simply replace the customer id for the Entity (same database as used in my Query) _dataHostService.ReplaceCustomerIdInDataHost(_datahostapikey, _owner, _newID, _oldCustomerID); this.Uncapsulate().ClearCache(); // Show the updated Customer with the new ID Customers.Single(s => s.CustomerIdInDataHost == _newID).Dump();
Re: Dumping of "new" property
Good call - the member on the derived type should take precedence. This should now be fixed in the 8.3.5 beta:
https://www.linqpad.net/linqpad8.aspx#beta
Re: Util.Dif with the Uncapsulate() conflict
You need to use
LINQPad.Extensions.Dump(Util.Dif(model .Uncapsulate().Dump(), model2.Uncapsulate()), "DIF");
The intellisense as you type .Dump as you have done is confusing as it implies that Dump will work, but if you try assigning your result to a variable and dumping that variable the intellisense tells it won't and what you need to do,
Re: Show dif names when diffing lists
If the purpose is just to remind yourself which list is which, then I'd just use
Util.Dif(firstList, secondList).DumpTell();
or you can set Enable automatic Dump-headings by default for new queries and just dump as per normal.