linqpad

Make internal classes visible to other assemblies

我怕爱的太早我们不能终老 提交于 2019-11-29 10:48:42
问题 Is it possible to make internal classes from my assembly visible to other assemblies? I know about the AssemblyInfo file and the [assembly: InternalsVisibleTo()] attribute, but it doesn't work in my case. The main purpose is to make it possible to call methods from LINQPAD, so this [assembly: InternalsVisibleTo("LINQPad")] doesn't work. I don't know why. In my project, I'm using dependency resolver, and it is hard to do such a thing in LINQPAD. Any suggestions? 回答1: I've just uploaded a new

How does LINQPad compile code?

谁都会走 提交于 2019-11-28 16:43:19
I am guessing it neither invokes csc.exe or implement an entire compiler, so how does it work? Update: Thanks to Jon Skeet for the pointer to code that was easy to learn from. string c = @" public class A { public static void Main(string[] args) { System.Console.WriteLine(""hello world""); } } "; CodeDomProvider compiler = new CSharpCodeProvider(); CompilerParameters parameters = new CompilerParameters(); parameters.WarningLevel = 4; parameters.GenerateExecutable = false; parameters.GenerateInMemory = true; CompilerResults r = compiler.CompileAssemblyFromSource(parameters, c); Assembly a = r

LINQPad in Visual Studio

那年仲夏 提交于 2019-11-28 16:24:42
public static class Extensions{ public static void Dump<T>(this T o) { } public static void Dump<T>(this T o, string s) { }} These lines allow me to copy code from LINQPad to VS and run it without commenting out every line with .Dump() but it's not enough... http://code.google.com/p/linqpadvisualizer/ - not very comfortable :( The best result I get searching for LINQPad in VS is this site with code below by Pat Kujawa. using System.Diagnostics; using System.IO; public static class Extensions { public static void Dump<T>(this T o) { string localUrl = Path.GetTempFileName() + ".html"; using (var

How to Connect to CRM Dynamics Online Odata endpoint LinqPad?

亡梦爱人 提交于 2019-11-28 12:48:21
I'm able to connect to self-hosted CRM sites just fine with the default Odata driver within LinqPad. The URI I use in the "WCF Data Services (OData) Connection" dialog for self-hosted is in the format http://MyServer.com/MyOrgName/xrmservices/2011/OrganizationData.svc . The user name is in the format "domain\username". When I attempt to follow the same format for an CRM Online instance, it doesn't work. I'm guessing it's either because of the https, or the windows live credentials, but don't know what steps to take to fix the problem... Please note, I want to use the odata provider, not the

Having trouble with LinqPad Adding a Connection to Entity Framework

前提是你 提交于 2019-11-28 11:16:09
I am new to Entity Framework and Linq to Entities and I want to try LinqPad but I can't figure out how to make a connection to the edmx model I have created. I have an MVC project and I added an ADO.Net Entity Data Model against a SQL Sever database ( a Development server, not one on my local machine) Did a Build.Right click in my designer surface and Add Code Generation Item. That has given me two .tt folders, one for my dbContext class, one with all my classes. Open LinqPad click on Add Connection. Point to the .dll file in my solutions bin folder, then in the Full Type Name of dbContext I

How can I improve the speed of .NET Plug-in Development?

无人久伴 提交于 2019-11-28 10:05:54
问题 I'm developing an AutoCAD add-in, which uses a .NET 4.6 assembly. I am finding the development process very frustrating; the API is very large and the documentation beyond getting started is all over the place and very hard to find. The only way to get anything done seems to be just prototyping functions in Visual Studio and seeing if it works. It then takes several minutes to load up AutoCAD and attach a debugger, which wrecks my prototyping workflow. It would be very handy if I could have

LINQPad, using multiple datacontexts

余生长醉 提交于 2019-11-28 04:05:00
I am often comparing data in tables in different databases. These databases do not have the same schema. In TSQL, I can reference them with the DB>user>table structure ( DB1.dbo.Stores , DB2.dbo.OtherPlaces ) to pull the data for comparison. I like the idea of LINQPad quite a bit, but I just can't seem to easily pull data from two different data contexts within the same set of statements. I've seen people suggest simply changing the connection string to pull the data from the other source into the current schema but, as I mentioned, this will not do. Did I just skip a page in the FAQ? This

Is there a library that provides a formatted Dump( ) function like LinqPad? [duplicate]

久未见 提交于 2019-11-27 19:30:27
This question already has an answer here: How do I use the LINQPad Dump() extension method in Visual Studio? [closed] 4 answers I work with a lot of Linq queries in my code, and I'm looking for a library that provides a formatted Dump() function similar to what LinqPad offers. LinqPad's Dump() extension method is really quite nice, because it handles nested collections very well. Ideally, it would print out pretty tables in plain text, but I'd be ok with spitting out HTML or other nicely formatted data. The ObjectDumper sample from VS does not cut it at all. This is what I've been using:

Is there a LINQPad equivalent to a DataContext class?

孤者浪人 提交于 2019-11-27 13:07:02
问题 I've just begun using LINQPad and so far I like it but most tutorials I have come across for LINQ TO SQL make use of a DataContext class which is generated by Visual Studio for persisting updates etc. I am also fairly new to LINQ TO SQL so my question is what is the equivalent of the following in LINQPad (if there is one)... MyDbDataContext db = new MyDbDataContext(); ... db.SubmitChanges(); 回答1: Short answer: You do not need to create the DataContext yourself. LINQPad comes with lots of

Having trouble with LinqPad Adding a Connection to Entity Framework

元气小坏坏 提交于 2019-11-27 06:04:55
问题 I am new to Entity Framework and Linq to Entities and I want to try LinqPad but I can't figure out how to make a connection to the edmx model I have created. I have an MVC project and I added an ADO.Net Entity Data Model against a SQL Sever database ( a Development server, not one on my local machine) Did a Build.Right click in my designer surface and Add Code Generation Item. That has given me two .tt folders, one for my dbContext class, one with all my classes. Open LinqPad click on Add