Quantcast
Channel: naspinski - steal some code
Browsing all 15 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Universal IQueryable Search Version 2 with Reflection

'google-like' search with an IQueryable made even simpler A little bit ago, I came out with this post: Universal IQueryable Search Usable by Linq-to-SQL and Linq-to-Entities and it worked great, but it...

View Article



Extensions for simplifying DropDownList interaction

Extensions for setting the selected value and removing an item from DropDownLists I love extensions, they make my life so much easier. Simple things that I can do in a coupole lines of code, I now do...

View Article

IQueryableSearch is now up on CodePlex

another open-source project released into the wild My IQueryableSearch class has been infinitely useful to me and saved me a ton of time. I have also gotten some good feedback on how useful it is. For...

View Article

Edit an Object Property Value Dynamically at Run Time

no need to write a huge switch statement to make a run time decision Imagine you have an Object with 50 properties, and at runtime, you only need to change the value of one of them. You could write a...

View Article

Generate random values in C#

all sorts of random values including date, times, numbers, binary, bit, etc. Nothing new here, but it's nice to have it all in one spot. generate random values public int Integer(int max =...

View Article


Random .Net SQL Generator (Open Source)

A random generator for all types of queries in SQL - extend-able to any SQL provider I have often ran into the case where I need to insert a bunch of random records against a table or do a lot of...

View Article

Serializing and DeSerializing XML Objects in .Net

these two simple extension methods with have you switching between XML and objects in no time First off, it is pretty well known that if you have any Object and want to convert it into an XML strong,...

View Article

Running C# libraries with the SQL CLR

You can run your dlls from inside SQL - but it is a bit limited Sometimes you need your SQL server to run a little bit of one of your programs, this is not a common case, but I have found it does...

View Article


Updating Multiple Fields via LINQ and Reflection Automatically (EF4)

You can use reflection to avoid manually entering a ton of fields Recently, the question was asked on Stackoverflow about updating multiple integer fields in an EF4 object without having to type each...

View Article


Deserializing ReCaptcha JSON with C#

Turning a ReCaptcha request into a strongly-typed C# object on the fly When requesting a ReCaptcha image, you send out this request: http://www.google.com/recaptcha/api/challenge?k=your_public_key You...

View Article

ReCaptcha - Getting the Challenge Key and/or image with Asp.Net MVC

Often times you do not need the whole deal, or you are working with a technology that doesn't employ javascript or iframes Recently I was working on a project that needed to provide (via MVC 3) the...

View Article

Monitoring a DOM Element for Modification with jQuery

'watching' an element for any change within it I recently ran into a situation where I had to modify a site that relied on an incredibly obfuscated and impossible to understand javascript file. I had...

View Article

Pluralize a String or Class Name in C# and .Net

Sometimes you need to pluralize names like when you are working with Entity Framework or countless other sitautaions When you auto-generate from tables in Entity Framework, it will make the table names...

View Article


Using a Custom Controller Class in Asp.Net MVC to Simplify Coding

Controllers often have some repetitive code, implementing your own Controller class can help eliminate a lot of this Here is a small snippet and how I use some simple tricks to help clean up my...

View Article

Helper Methods for Validating Generated Linq-to-Entities edmx Files using...

Centralized client and server side validation as well as property and method additions to auto-generated classesSay I have an auto-generated Widget class (from a database, generated into a .edmx file):...

View Article

Browsing all 15 articles
Browse latest View live




Latest Images