Archive - .Net Issues

ASP.Net MVC Issue: Form With Get Method Not Passing Request Values

27 July 2009 by Sean, 2 Comments

DISCLAIMER: This has a solution but there has to be a better way. So I came across a really odd situation with the MVC framework today, and I’m on the edge of some serious Nerd Rage. Here’s the issue: I have a route that looks like this: “{controller}/{action}/{roomId}/{name}” And a form that looks like this: [...]

Tags:

Entity Framework: LINQ to Entities only supports casting Entity Data Model primitive types

21 July 2009 by Sean, No Comments

So in typical tool fashion I posted this little gem without realizing a glaring error… the order by clause. The whole idea is to create a method that can get a collection, sort it, then grab a certain number for paging. The issue was this: Expression<Func<K, IComparable>> orderBy The problem comes in when the entire [...]

A relationship is being added or deleted from an AssociationSet … With cardinality constraints, a corresponding … must also be added or deleted.

4 May 2009 by Sean, No Comments

So I ran into this error yesterday trying to delete a user which in turn has multiple collections that would be deleted too. You would think that I would have to manually delete the entire User tree, on collection at a time. Well the way thing work is that Entity framework will do the work [...]

My jQuery Primer

4 February 2009 by Andre, 21 Comments

So you have been reading about jQuery and want to dive in and try some? I recently attended the MSDN Dev Conference in Detroit where jQuery integration and client-side programming were very hot topics. With Microsoft’s acceptance of the open source library, I figured I would give it a try. This is what I have [...]

Tags:

Change Target Framework on a Class Library (Visual Studios 2008)

9 November 2008 by Sean, No Comments

Ok so this is a quick one but annoys the hell of of me. Basically I am working with a 2.0 class library project and I wanted to use Linq. Now you would think when you “upgrade” the project to 3.5 using the wizard, the target framework would follow. Well, you are stupid. Now for [...]

Cannot Resolve Method, Can’t Infer Return Type, and Funcs

6 November 2008 by Sean, No Comments

So ran into this today and the answer was actually a lot easier to understand than I thought it would be. Say you want to order a list of objects by a number. Seems simple. Now if you have been paying attention you would know I like using Funcs. Func<SomeClass, Int32> orderByNumber = currentClass => [...]

Like versus Contains in Linq

22 July 2008 by Sean, No Comments

So have to figure this one out. Say you have: private static Expression<Func<User, Boolean>> WhereLikeFirstNameLastNameUserName(String name) { return currentUser => SqlMethods.Like(currentUser.UserName, “%” + name + “%”) || SqlMethods.Like(currentUser.FirstName, “%” + name + “%”) || SqlMethods.Like(currentUser.LastName, “%” + name + “%”); } And private static Expression <Func<User, Boolean>> WhereLikeFirstNameLastNameUserNameWithoutLike(String name) { return currentUser => currentUser.UserName.Contains(name) || [...]

Tags: , , ,