background preloader

.NET

Facebook Twitter

Ioc

Embedding JavaScript Strings from an ASP.NET Page : CSharpFeeds. Source Code Search Engine. Dynamic LINQ (Part 1: Using the LINQ Dynamic Query Library) LINQ (language integrated query) is one of the new features provided with VS 2008 and .NET 3.5. LINQ makes the concept of querying data a first class programming concept in .NET, and enables you to efficiently express queries in your programming language of choice. One of the benefits of LINQ is that it enables you to write type-safe queries in VB and C#. This means you get compile-time checking of your LINQ queries, and full intellisense and refactoring support over your code: While writing type-safe queries is great for most scenarios, there are cases where you want the flexibility to dynamically construct queries on the fly. For example: you might want to provide business intelligence UI within your application that allows an end-user business analyst to use drop-downs to build and express their own custom queries/views on top of data.

Traditionally these types of dynamic query scenarios are often handled by concatenating strings together to construct dynamic SQL queries. Scott. Dependency Patterns: Optional Dependencies and Primal Dependenci. Jim Newkirk is blogging about the down side of setup and teardown methods in test classes, and why you shouldn’t use them. Setup and teardown methods attract entropy faster than an outsource programmer with his first patterns book. Jim’s new framework, xUnit.NET doesn’t have primitives for setup and teardown, although it sounds like there are mechanisms that could be used to accomplish the same kind of thing.

Roy feels that xUnit.NET isn’t quite there yet. I think that Roy’s perspective will be reflected by lots of folks who have become used to NUnit (et al) over the past six years. I think that Jim is on the right track, but I’m the kind of guy that feels that a test class’s greatest responsibility is to document behavior in the clearest possible way, even if that means sacrificing design qualities best reserved for functional code – like reuse. An RSpec context (“Describe” block) doesn’t have a direct equivalent in .NET and NUnit, but the spirit of a test context can still be achieved. Cutting Edge: Canceling Server Tasks with ASP.NET AJAX -- MSDN M. Cutting Edge Canceling Server Tasks with ASP.NET AJAX Dino Esposito Code download available at:CuttingEdge2007_08.exe(167 KB) Last month I built a framework to monitor ongoing server-side tasks from the client.

Using this framework, which I’ll call Progress Monitor Framework (or PMF), you can provide Web users with information about the progress of operations running on the server, something that typically requires a lot of custom code to do. With PMF, you can have a server-side task register the current state of its operation (as a percentage or as an estimate of the time left) and a client service to ping the server to read that state information. Some early feedback about last month’s column pointed out two potential enhancements. Formalizing Remote Tasks A remote task is a piece of code that executes on the server in response to a client event.

Once the task on the server has been triggered, the client no longer has control over it. Canceling Tasks the Easy Way The Client Code if (this.