background preloader

Code-First Development with Entity Framework 4

Code-First Development with Entity Framework 4
.NET 4 ships with a much improved version of Entity Framework (EF) – a data access library that lives in the System.Data.Entity namespace. When Entity Framework was first introduced with .NET 3.5 SP1, developers provided a lot of feedback on things they thought were incomplete with that first release. The SQL team did a good job of listening to this feedback, and really focused the EF that ships with .NET 4 on addressing it. Some of the big improvements in EF4 include: POCO Support: You can now define entities without requiring base classes or data persistence attributes.Lazy Loading Support: You can now load sub-objects of a model on demand instead of loading them up front.N-Tier Support and Self-Tracking Entities: Handle scenarios where entities flow across tiers or stateless web calls.Better SQL Generation and SPROC support: EF4 executes better SQL, and includes better integration with SPROCsAutomatic Pluralization Support: EF4 includes automatic pluralization support of tables (e.g.

Extending Client-Side Programming in ASP.NET 4 Practical ASP.NET Extending Client-Side Programming in ASP.NET 4 ASP.NET 4 adds a wealth of features for client-side developers, including new ways of instantiating controls, a new infrastructure for managing libraries and some minor but much-needed tweaks. The first half of 2010 has seen tremendous change for ASP.NET client-side developers: the Microsoft commitment to jQuery at MIX10, the implementation of the Content Delivery Network (CDN), and the release of both Visual Studio 2010 and the Microsoft .NET Framework 4. Here's an overview of what you can use now and what's waiting for you when you upgrade to .NET 4. New Infrastructure Developers constantly find themselves adding standard libraries of JavaScript code to their Web sites in order to access the functionality in the library. You can find a complete list of the available libraries (which includes the Microsoft AJAX scripts, all the scripts in System.Web.dll and the core jQuery libraries) here. Sys.onReady (function () { } );

10 Free Online Books for Web Designers There’s a never ending supply of information out there for us web designers. If there’s something we need to learn, we can find it in one form or another. Sometimes it may be on a blog or it could be in a book. A Practical Guide to Designing for the Web A Practical Guide to Designing for the Web aims to teach you techniques for designing your website using the principles of graphic design. Getting Real Getting Real is the business, design, programming, and marketing philosophies of 37signals — a developer of web-based software used by over 1 million people and businesses in 70 countries. The Elements of Typographic Style Applied to the Web In order to allay some of the myths surrounding typography on the web, is structured to step through the principles found in Robert Bringhurst’s The Elements of Typographic Style, explaining how to accomplish each using techniques available in HTML and CSS. jQuery Fundamentals Web Style Guide, 3rd Edition Access by Design Web Designer’s Success Guide

Practical ASP.NET: Managing the Web.config File Practical ASP.NET Moving the Web.Config to Production in ASP.NET 4.0 Microsoft has another solution for managing your Web.config file as you move your site to production. And, no matter what the name of this feature suggests, you don't have to learn XSLT to use it. The Web.config provides a central point of control for those few, but critical, items that change between the development/test environment and the production environment. Of course, it also means that if you deploy your Web.config file incorrectly, your production system ends up updating your development database and running in debug mode. In many ways, the best solution to managing the Web.config file is the simplest: set up your Web.config on your production server and never change it again. With ASP.NET 4.0, Microsoft has another solution: Web.config transformation. There is really only two pieces of bad news here. Which config file's changes are applied is driven by the current setting in Build | Configuration.

prog21: Explaining Functional Programming to Eight-Year-Olds "Map" and "fold" are two fundamentals of functional programming. One of them is trivially easy to understand and use. The other is not, but that has more to do with trying to fit it into a particular view of functional programming than with it actually being tricky. There's not much to say about map. Given a list and a function, you create a new list by applying the same function to each element. There's even special syntax for this in some languages which removes any confusion about whether the calling sequence is map(Function, List) or map(List, Function). [X + 1 || X <- List] Fold, well, it's not nearly so simple. lists:foldl(fun(X, Sum) -> X + Sum end, 0, List) It's short, but it's an awkward conciseness. Compare this to the analog in array languages like APL and J. turns to this: giving a result of 21. Now there are some edge cases to worry about, such as "What does it mean to insert a function between the elements of a list of length 1"?

Can .net 2.0 app access/load .net 4.0 assemblies/dll's Hi Eric, What a coincident just came online to update. Eric thanks a lot for timely advice. I had decided on two options 1. run .net 2.0 project under .net 4.0 CLR 2 . i almost lost hope on the first option and end up doing the 2nd one, luckly the second option worked for me but still neede official document/links on WSE 2.0 support on .net 4.0. looking at eric's reply i started working on 1st option from scratch and guess what? here are the details For .net 2.0 exe projects (windows/GUI & windows services) simply create/update "app.exe.config" file with note: after we add from VS studio config file we need to manually edit to append ".exe" to the file, by default vs creates "app.config" which does not work not sure why???? for more details check this link IIS7.0 for IIS 6.0 Setting Application Mappings in IIS 6.0 (IIS 6.0).

HTML5 Programming with F# - Don Syme's WebLog on F# and Related Today I spent the afternoon with Manuel Serrano, designer of Hop, a Scheme variation for cross-tier web programming, targeting JVM and Javascript. This is highly related to WebSharper, which lets you program HTML/Javascript/Ajax with F#. I was very pleasantly surprised to see that WebSharper includes demos of HTML5 programming with F#. For example: · HTML5 Canvas Sample · HTML5 Canvas Animation You’ll need a HTML5-enabled browser - these are web apps, so you won't need anything else. If you want to develop web apps like these with F#, WebSharper Standard is now available as a free download, as recently announced by Adam Granicz. The F# code for these apps is impressively succinct and clear. Now that WebSharper has been released and matured, it will be great to see it used more widely by F# users. Here's a snippet for the animated clock: [<JavaScript>] let AnimatedCanvas draw width height caption = let canvas = new Canvas.Canvas(width, height) let ctx = canvas.Context let rec loop = async { do! Don

How to Create Your Own Email Aliases On The Fly Simon recently wrote about tempalias, one of a growing number of services that lets users create temporary email addresses. If you want to be able to create your own temporary email addresses (also known as aliases) without having to use such a service, here’s an old trick that I use. It takes a little setting up, but once operational, it’s even easier than adding + signs to email addresses to create aliases. Here’s what you’ll need: A domain name that you don’t use for anything else. Any email server that allows you to create “catch-all” accounts. Setup is reasonably simple, and takes around 10 minutes: Select a domain name. Once the Google signup is completed, you’ll be taken to the Google Apps Dashboard. Now any email sent to any address on that domain will be forwarded to “catchall@my_domain.net”. How do you avoid spam? Related GigaOM Pro content (sub. req.): Email: The Reports of My Death are Greatly Exaggerated

Criminal Overengineering « yield thought As programmers we’re continually accused of doing a sloppy job. There are countless programs in the wild, crashing, locking up and accidentally writing “I am a fish” a million times over someone’s mid-term essay. The effect? Something like this: This damn computer and excel r fuckin my life up! It’s experiences like this that cause people to rant about Microsoft and curse the anonymous programmers who suddenly (yet inevitably) betrayed them. If we stopped at competent error handling and sufficient testing, all would be well. A vast proportion of software at work today is horribly over-engineered for its task. You’re Doing It Wrong Have you ever seen someone using the strategy pattern when they should’ve used a 5 line switch statement? … into a hideous, malformed mutant beast like this one, which I haven’t inlined because it’s far too long. The most insidious cause of overengineering is over-generalizing. Except, this doesn’t make us good programmers. Don’t Worry, Be Happy Like this:

Some lesser-known truths about programming | Dot Mac My experience as a programmer has taught me a few things about writing software. Here are some things that people might find surprising about writing code: Averaging over the lifetime of the project, a programmer spends about 10-20% of his time writing code, and most programmers write about 10-12 lines of code per day that goes into the final product, regardless of their skill level. Good programmers spend much of the other 90% thinking, researching, and experimenting to find the best design. Bad programmers spend much of that 90% debugging code by randomly making changes and seeing if they work.A good programmer is ten times more productive than an average programmer. A great programmer is 20-100 times more productive than the average.

How Limitations Improve Design We often complain about the multitude of limitations which we’re faced with every day as designers. From browsers, to screen resolutions, to user interactions, we seem to constantly be struggling to find some way of thinking outside the tiny little box of “best practice” which we’re constrained by. Limitations are abundant but are they really such a bad thing? Is it possible, even, that they actually produce far better results than if we did not have them? Ikea for example, starts with price and then work backwards. Their main concern is the price of the product to the end user. 37Signals wrote a whole book about how they operate with similarly heavy restrictions when building web apps; they set a date to launch and then they stick to it, no matter what. Sometimes Freedom Isn’t a Good Thing Without constraints, things can get crazy. Now I’m not saying that all Flash sites are bad, or that all people who make them are bad designers. Limiting Color Limiting Typography Limiting Size Conclusion

Technology | Between a rock and an interface The web regularly delights Bill Thompson with what it finds for him Designers and developers should be consulting their psychologists, says Bill Thompson One of the most wonderful things about spending a lot of my day online is that there is always something interesting to read when work gets boring or I'm waiting for the coffee to brew. And I don't even have to go looking for things to read, as the Bloglines news aggregator brings the latest postings from the ninety-two websites I'm most interested in to one place, checking their RSS feeds and managing them for me. All I have to do is skim through looking for anything that catches my eye and seems worth a little attention. So today I got to see what claims to be the best ever photograph of Jupiter taken from an earth-based telescope, captured by an 8.2m telescope in Chile using new "adaptive optics", and learned that Superstruct, the Institute for the Future's "massively multiplayer forecasting game", has just gone live. Winding way

Getting Lazy with System.Lazy - Derik Whittaker - Devlicio.us - One of the pretty cool new nuggets inside the .Net 4.0 framework is System.Lazy and System.Lazy<T>. What System.Lazy brings to the table is a way to create objects which may need to perform intensive operations and defer the execution of the operation until it is 100% absolutely needed. Lets take a look at how to use the System.Lazy type. To better convey how to use this type we should first create some context. In our example (trivial i know) we will have an orders factory which creates orders. Take a look at the code below. Pay attention to the Console.WriteLine in each factory method, these lines will provide us an indication of when the execution of these methods takes place. Now that we have context, lets look at the example code for System.Lazy In the code below we are going to call into the order factory and NOT use the values it returns right away. If we run this console application you will receive the following information: Till next time,

The iPhone is the new Internet Explorer 6, says mobile developer The iPhone: is it bad for mobile web development? On the flip side of the debate about whether Flash is ill, in rude health, or simply untroubled by Apple's wilful refusal to countenance it on the iPhone/iPod Touch/iPad, we have an analysis from Peter-Paul Koch, a "mobile platform strategist, consultant and trainer" who says (with plenty of swearing to boot, if you're in filter territory) that the iPhone is the Internet Explorer 6 de nos jours. Yes. That's right. He's saying: don't develop for it. Or rather, don't develop exclusively for it to the exclusion of other mobile browsers, and certainly don't give it special status. The long, detailed and faintly angry blogpost doesn't pull any punches: "The iPhone has become an obsession. Oh? 1. 2. 3. 4. Would you agree with those sentiments, even if we're back in 2000 and IE6 is really the best browser we have? Well, would ya, punk? Certainly he's making some of the same points that were made in comments to my earlier post about Flash:

Related: