Tag | LINQ Posts

In this Issue: Alex van Beek, René Schulte(-2-), Peter Kuhn, Kunal Chowdhury(-2-, -3-), Alex Golesh(-2-, -3-, -4-), WindowsPhoneGeek, Jesse Liberty, Nigel Sampson, Jeremy Likness, and Paul Sheriff. Above the Fold: Silverlight: "Entity Framework 4.1 Code First, Silverlight, and Shared Models with REST+JSON" Jeremy Likness WP7: "Windows Phone Mango–What’s New? (“Silverlight/XNA Interoperability” - Part 7 of 8)" Alex Golesh LINQ: "LINQ Deferred Execution–Oops!" Jesse Liberty Shoutouts: My friends at ...
Looks like bloggers figured out I'd post the submittals first, because today I got hammered with posts. In this 2nd in a row Submittal-only Issue: Alex Golesh(-2-, -3-, -4-, -5-), René Schulte, Alex van Beek, Kunal Chowdhury(-2-), Rudi Grobler. Above the Fold: Silverlight: "Silverlight 5 Multiple Window Support" Kunal Chowdhury WP7: "Augmented Mango - SLARToolkit for Windows Phone" René Schulte WP7: "Windows Phone Mango–What’s New? (“New Sensors & Tooling Enhancements” - Part 3 of 8)" Alex Golesh ...
“Design Patterns 100? is a prerequisite for .NET Developers. (Part 5 – Excerpts from July 2010 – PhillyNJ.NET Presentation) Continuing our discussion from Part-4 we ask. What are the “Gang of Four” (GoF) Behavioral Patterns and where can we find them in the .NET Framework? Chain of Responsibility Pattern – A way of passing a request between a chain of objects Command Pattern – Encapsulate a command request as an object Interpreter Pattern – A way to include language elements in a program Iterator ...
I was working on a MVC3 project with jqGrid using JSON. The data was created using EF4 Code First. Took me a while to hook up the grid and actually having it post back to the server to retrieve the JSON. I was having issues with my int ID column not formatting to JSON. LINQ to Entities does not recognize the method 'System.String ToString()' method, and this method cannot be translated into a store expression. StackOverflow had some responses to use SqlFunctions.StringConvert(... ...
Here are the updated links for quick reference: Windows Phone SDK Beta Download Center: http://go.microsoft.com/?li... Go live license– http://go.microsoft.com/?li... WPDT 7.1 Documentation Windows Phone Developer Tools 7.1 Release Notes: http://go.microsoft.com/fwl... What’s New in Windows Phone Developer Tools: http://go.microsoft.com/fwl... Code Samples for Windows Phone: http://go.microsoft.com/fwl... App Hub Links Announcement: http://create.msdn.com/en-U... ...
Materials for the PHILLNJ.NET Presentation – August 24, 2010 On August 24, 2010 I demonstrated the “Repository Pattern” which is a Enterprise Architecture Design Pattern and the foundation of Domain Driven Design (DDD) which is primary in loose coupling your applications design. At this presentation I demonstrated the use of the “Repository Pattern” combined with other subjects such as Unit Testing, Custom Mocking with LINQ & Generics. I also gave out a limited number of CD with the code and ...
Its been a while since I blogged. Its been hard balancing blogging time, work and many other activities. Most my days and even evenings have been cluttered with a number of tasks ranging from mundial to critical. There is some which have been most interesting include very nice lessons I took from from some of the people I respect in the industry. I will try and highlight some of the things I did in below. 1) The DataObjects.NET contribution programme. From February this year I quickly responded to ...
I've created IsSubsetOf List extension based on discussion at http://stackoverflow.com/qu... /// <summary> /// Determines whether a System.Collections.Generic.... object is a subset of the specified collection. /// http://stackoverflow.com/qu... /// </summary> /// <param name="list"></param> /// <param name="listToFind"></p... ...
In this Issue: Morten Nielsen, Kunal Chowdhury, John Papa, Jesse Liberty, Mike Taulty(-2-), and Pete Brown. Above the Fold: Silverlight: "Custom Cursors in Silverlight" Morten Nielsen WP7: "Coming in Mango–Sql Server CE" Jesse Liberty Silverlight 5 Beta: "Silverlight 5: Using the SoundEffect Class for Low-Latency Sound (and play WAV files in Silverlight)" Pete Brown Shoutouts: Khawar Yunus sent me this link to his app... I'm not going to tell you to make a login, but I did.. and the app is a pretty ...
Last, I needed a function to add paging. The first problem I had, was how to this. A couple of seconds later, I allready had a solution to this problem: Linq Skip and take will do the trick. list<t>.Skip(_howMany... This won't crash if you pass one of both statements. It will just return the result. source.Skip(startRowIndex).... I've created an extension method to use this function. VB Module LinqHelpers <System.Runtime.Compiler... ...
Let’s focus on Exam 70-516 this time. This exam is TS: Accessing Data with Microsoft .NET Framework 4. Additional Resources: http://msdn.microsoft.com/e... The exam objectives are: Modeling Data Map entities and relationships by using the Entity Data Model http://msdn.microsoft.com/e... http://msdn.microsoft.com/e... http://msdn.microsoft.com/e... Map entities and relationships by using LINQ to SQL http://msdn.microsoft.com/e... ...
I just finished delivering 4 sessions for www.sswug.org at the end of April 2011. Above is a screenshot that was taken inside of the studio. Now, I am going to do a webinar on Silverlight 5 then head to Knoxville, TN and finally Chattanooga, TN. Keep reading for details on the events: SilverlightShow.net Webinar on “Getting started with the Silverlight 5 Beta.” Wed, May 11th, 10 am PST (check your local time) Register for this webinar This webinar is designed for people who want to quickly understand ...
At http://json.codeplex.com there is an excellent open source project for accessing JSON data from Dot Net. The home page states: Features -Flexible JSON serializer to convert .NET objects to JSON and back again -LINQ to JSON for reading and writing JSON -Writes indented, easy to read JSON -Convert JSON to and from XML -Supports Silverlight and Windows Phone The JSON serializer is a good choice when the JSON you are reading or writing maps closely to a .NET class. The serializer automatically reads ...
<Updated 2011-5-1: slides and code from SPSSTL linked below (or click here) and sessions for SPSMI added> <Updated 2011-5-15: slides and code from SPSMI linked below (or click here)> April 30th, 2011 I’ll be presenting at SharePoint Saturday St. Louis. My presentation is “The Expanding Developer Toolbox for SharePoint 2010” which covers many of the new tools and functionality available to developers. This session is fairly demo heavy but stays more on the “overview” side rather than deep ...
Sometimes, the way that LINQ to Twitter materializes queries into entities isn’t immediately clear. It’s easy to get confused until you see the patterns or make a correlation between the Twitter API results and their representations as LINQ to Twitter entities. In this post, I’ll explain some of the logic behind the design of LINQ to Twitter entities and demonstrate an example of one of the more oddly designed entity types, Search. Note: They'll be talking about MVC3 during multiple sessions at Tech-Ed. ...
The list provided below is my “Best-Of” FREE Frameworks, Tools and Controls for Windows Phone 7. I have used everything listed below in an my WP7 applications. Most of them are in the marketplace at this point and some are still in development. Let’s get started. If you are developing WP7 Applications, this is one that you have probably heard of already. It is Microsoft’s official set of controls that comes complete with full source code of course. Project Description: Welcome to the Silverlight ...
In this Issue: Michael Washington, Morten Nielsen, John Garland, Bil Simser, Adam Nathan, András Velvárt, WindowsPhoneGeek(-2-), Jesse Liberty(-2-), Martin Krüger, Damon Payne, and Xianzhong Zhu. Above the Fold: Silverlight: "Using ICustomTypeProvider in Silverlight 5" Damon Payne WP7: "Hardware Back Button + Marketplace Certification" Adam Nathan Lightswitch: "Deploy Your LightSwitch Application As A DotNetNuke Module" Michael Washington From SilverlightCream.com: Deploy Your LightSwitch Application ...
One of the greatest benefits I’ve found in simple web output in ASP.NET is the GridView. I regularly use it to display data from objects or databases where the output can simply be shown in a grid form (similar to instances where I would deliver a read-only spreadsheet). I attach the GridView to the <asp:PlaceHolder /> inside of a <form /> on the aspx page: A simple, bulk method of getting the data into the GridView is with the GridView.DataSource property. A GridView.DataSource must ...
The application I'm currently working on performs user authorization using authorization objects injected into Service Layer methods using Unity Interface Interception. For a simplified example, the CustomerService Service Layer object implements ICustomerService: public interface ICustomerService { void UpdateCustomer(int customerId, string name); } ...and has an authorization object injected into UpdateCustomer() method calls which checks that the user currently assigned to the thread is allowed ...
April 30th, 2011 I’ll be presenting at SharePoint Saturday St. Louis. My presentation is “The Expanding Developer Toolbox for SharePoint 2010” which covers many of the new tools and functionality available to developers. This session is fairly demo heavy but stays more on the “overview” side rather than deep dive. I’m excited to visit St. Louis again as I have a number of friends who live there and I’ve heard the SharePoint community is in full swing. Click here for registration information. May ...

A list of some shortcus and new features to VS 2010 and C# 4.0:

Read more at http://blog.danskingdom.com/some-visual-studio-2010-shortcuts-and-c-4-0-cool-stuff/

As I discussed in my last post, we created a TimeSpinner control based on the Extended WPF Toolkit’s ButtonSpinner. Now, the toolkit has a DateTimeUpDown control that will display a date or time and allow the user to click the spinners for each time part, but I needed a little more. I needed the raw text to be editable and I wanted the spinners to just modify the minutes portion. I also wanted to have special parsing based on the number of characters entered. 4 chars:Parse as military time. 3 chars: ...
I am very excited to help share this news with you today! I feel as excited today as I was when Windows Phone 7 developer story was revealed at MIX10 last year. I see so many more application scenarios with the new tools and features in Windows Phone 7. There has been a few announcements made at MIX11 – let me recap some of what I find important. There was not a disclosure or showing of any new end-user features. There is a commitment to delivering the next update later this year as a free updates ...
Well, another Philly Code Camp has come and gone, and it was a great time. I made it a one-day trip, which I think I'm getting too old to keep doing. Left the house at 4 AM from Pittsburgh, made it to Philly by 8:15 AM; I left around 4 PM and got home by 9 PM (no thanks to my TomTom, which took me on a scenic tour of old town Fort Washington). I was expecting a nice and relaxing day at Philly Code Camp where I had one talk (A Beginner's Guide to LINQ) at 2 PM; but I got an email from Marc Ziss asking ...
This post is from a very good friend of mine, Billy Hollis. He’s got some interesting food for thought and I think you’ll enjoy his perspective! For over 15 years now, our industry has been struggling with a crucial tradeoff. We can get broad reach via standards, or we can get the best possible user experience with applications that take advantage of particular devices or platforms. It's a stereotype that people in software development tend to be code and technology centric and not user centric. ...
Last time I posted something regarding Converting IP Addresses to Decimal and Looping an IP Address Range The next step is to do something with those remote IP Addresses. The first thing that we can play with is to get some information from a remote host using Netbios Name Service. Some of the information that we can get using the class below are 1. Mac Address 2. Netbios Name (Computer Name) 3. Netbios Group (Workgroup name, Domain Name) 4. Netbios Username Below is the initial helper class I coded ...
First, create a class containing two members: value and id. Value is what is displayed in the combobox while id is associated with that value. I like to create a “global” class to contain properties and classes that is used through out the project. In this case, I have a class defined as clsCHTLCommon. In this class, I’ve defined this class: 1: using System; 2: using System.Collections.Generic; 3: using System.Linq; 4: using System.Text; 5: using System.Data; 6: using baseSql; 7: 8: namespace CHTL_HMI ...
This article is Part 3 of the series “Producing and Consuming OData in a Silverlight and Windows Phone 7 application.” You can read any of the parts you may have missed by clicking on the links below. Producing and Consuming OData in a Silverlight and Windows Phone 7 application. (Part 1) – Creating our first OData Data Source and querying data through the web browser and LinqPad. Producing and Consuming OData in a Silverlight and Windows Phone 7 application. (Part 2 ) – Consuming OData in a Silverlight ...
Previously we've talked about how to fetch the data from the database and populate the form with EF. In this example I'm going to demonstrate how to do Edit,Update and Delete operations in the form with Entity Framework. And oh since this is a continuation of my previous example I would suggest you to refer that first before you go any further. STEP 1: Setting up the UI Since this is a continuation of my previous example then I'm jus going to use the same layout and extend it a bit by adding some ...
In Part 1 we've talked about how to insert data to the database with Entity Framework. In this part I'm going to demonstrate how to fetch the data from the database and populate the form fields with Entity Framework. STEP 1: Setting up the Form To get started let's go ahead and fire-up visual studio and add a new WebForm. For the simplicity of this demo I just set up the form like this: <asp:Content ID="Content2" ContentPlaceHolderID="MainC... runat="server"> <asp:DropDownList ID="ddlUser" ...
Few months ago I wrote a series of articles regarding how to Insert, Update, Fetch and Delete data in the form using LINQ to SQL. You can view the series of articles below: Inserting Data to Database using LINQ to SQL Fetching Data from Database and Populating fields in the Form using LINQ to SQL Editing, Updating and Deleting Data in the Form using LINQ to SQL In this article I'm going to demonstrate the basics on how to work with MS Entity Framework. Basically in this part I'm going to show you ...
Over the last few days I’ve been coding away with several ORMS and code generators trying to find me one which I am comfortable with. Here is what I learn Not all ORMs are perfect! SubSonic Telerik OpenAccess nHibernate via Code smith Generator and LLBLGen LLBLGen Pro Framework SubSonic This is an awesome piece of work my Mr. Conery (and team)…for FREE! I’ve been using this for quite a while now. It is excellent for small projects, both Web and Winform apps. It’s a breeze to setup and get off and ...
I have a .Net 4.0 site that uses Entity Framework and Linq to SQL. After reworking a few tables and a few page operations, a new error appeared: "Row not found or changed". Every time I commit changes to a particular table, this error would be raised. From a quick review of msdn and the internet, the primary reason for this exception appears to be data concurrency issues - (The source data in the database is out of sync with the data you are attempting to update.) That did not apply to my development ...
If you hate being a mindless drone in some Illogical software sweatshop, switch to T4. Note that you cannot use reflection - you must use EnvDTE or your VS instance will lock. Use the T4Toolbox to access the current TransformContext to pull classes from files. Apply an iteration to generate properties in the target class that use the model source class for backing properties and change notification. It just works! <#@ templatedebug="true" hostSpecific="true" #> <#@ outputextension=".cs" ...
In this Issue: Roy Dallal, Rudi Grobler, Jeff Prosise(-2-), Jesse Liberty, Morten Nielsen, Derik Whittaker, Peter Torr, Xianzhong Zhu, and Adam Kinney. Above the Fold: Silverlight: "Silverlight: Adding Google Streets View" Roy Dallal WP7: "Using the accelerometer to control planar transforms on Windows Phone 7" Morten Nielsen Shoutouts: Andy Wigley posted this today from appamundi: Want a FREE Windows Phone?? From SilverlightCream.com: Silverlight: Adding Google Streets View Roy Dallal posted an ...
I've seen a few guys asking on stack overflow and forums how to order randomly using LINQ.
Here's a simple solution using Guid:

OrderBy(x => System.Guid.NewGuid())
I'm just getting to grips with MVC linq etc etc and came across what looks like a common stumbling block. For the more experienced of you reading this please refrain from shouting "Dumbass" at me. All the tutorials are either Code First examples or they create the database from scratch in the App_Data directory. All well and good for a tutorial that need to be easily portable to the readers computer, but not very helpful when setting up a full scale MVC application. My first problem was my lack of ...
(these are lifted verbatim from Microsoft here, here and here and are presented below only because it’s convenient to have them lumped altogether…) Getting Started with Windows Phone Windows Phone development platform supports both XNA Framework and Silverlight. This unit takes you through the step-by-step creation of your first Windows Phone Silverlight application. Hands-On Labs · Hello Windows Phone This lab intends to be the classic "Hello World" application, introducing you to the tools and ...
This article is Part 2 of the series “Producing and Consuming OData in a Silverlight and Windows Phone 7 application.” Producing and Consuming OData in a Silverlight and Windows Phone 7 application. (Part 1) – Creating our first OData Data Source and querying data through the web browser and LinqPad. Producing and Consuming OData in a Silverlight and Windows Phone 7 application. (Part 2 ) – Consuming OData in a Silverlight Application. Producing and Consuming OData in a Silverlight and Windows Phone ...
While I have been using Linq to Object for a couple of years now I had not investigated Linq to SQL up to this point. I figured I would put together my take on this technology’s use. Linq is a wonderful syntax for navigating an object graph without having to walk the graph object by object and member by member. It is concise and compact but for someone who has never seen its syntax you would swear you went from reading English to obscure mathematic notation. If you want to learn about the general ...
A recent project used Enterprise Library Validation to validate domain objects, and needed it configured for a web front end, a WCF front end, and (of course) unit tests. The same configuration in 3 different places didn't strike me as very DRY, so I figured hey - why not have it configure itself? Here's a quick paraphrase of how I did it. I started with an abstraction of the validation service:public interface IValidationService { bool IsValid<T>(T objectToValidate) where T : class; }...which ...
In this Issue: Roy Dallal, Mike Snow, Jesse Liberty, Chris Koenig, John Papa, Jeremy Likness, Michael Crump, Chris Rouw, and Beth Massi. Above the Fold: Silverlight: "Clean Design-Time Friendly ViewModels: A Walkthrough" Jeremy Likness WP7: "WP7 Insights #3: Storing User State - Activating and Deactivating" Chris Rouw Shoutouts: Shawn Wildermuth announced a new version of his "Phoney Tools": Phone Tools v0.6 Released - Breaking Change! ... breaking changes and some new stuff too. Takeshi Eto at DiscountASP.NET ...
I have started a new series on SilverlightShow.net called Producing and Consuming OData in a Silverlight and Windows Phone 7 application. I decided that I wanted to create a very simple and easy to understand article that not only guides you step-by-step but includes a video and full source code. I personally believe this is the best way to teach someone something and I hope you enjoy the series. I also want to thank SilverlightShow for giving me this opportunity to help other developers get up to ...
Well, will you look at that - no sooner do I write my first blog about an extension method I've written for accessing deployed Assemblies and Types, than I discover today that it doesn't actually work quite how I intended it. Excellent! The issue is in scenarios where assemblies are copied into a deployment directory as and when they're needed, which I attempted to work around in the original version by calling GetTypes() on all the Assemblies which are found. That gave me the following problem: ...
In this Issue: Colin Eberhardt, XamlNinja, Andrea Boschin, Michael Washington, Michael Crump, Alex Knight, WindowsPhoneGeek, Jesse Liberty(-2-), Damon Payne. Above the Fold: Silverlight: "7Metro: Silverlight Theme" Alex Knight WP7: "Metro In Motion – Fluid List Animation" Colin Eberhardt Lightswitch: "LightSwitch Online Ordering System" Michael Washington Shoutouts: Laurent Bugion announced MVVM Light V4 preview 2 (BL0015) #mvvmlight Max Paulousky posts that The Prism Team Needs Your Help From SilverlightCream.com: ...
This code didn't quite work how I intended, so I've updated it in a follow up blog. So - first post - might as well start with an extension method of mine I've found rather useful recently. It returns a collection of Types from all locally-deployed Assemblies, optionally filtering by Assembly and Type. It's an extension method on Assembly, so if you wanted to get all the available Types which implement the IService interface, you could call IEnumerable<Type> services = Assembly.GetExecutingAssemb... ...
If you've been a loyal Reflector user, you've probably been exposed to the debacle surrounding RedGate's decision to no longer offer a free version. Since then, the race has begun for a replacement with a provider that would stand by their promises to the community. Mono has an ongoing free alternative, which has been available for a long time. However, other vendors are stepping up to the plate, with their own offerings. If Not Reflector, Then What? One of these vendors is Telerik. In their recent ...
Not too long ago, Microsoft released, NuGet, an automated package manager for Visual Studio. NuGet makes it easy to download and install assemblies, and their references, into a Visual Studio project. These assemblies, which I loosely refer to as packages, are often open source, and include projects such as LINQ to Twitter. In this post, I'll explain how to get started in using NuGet with your projects to include: installng NuGet, installing/uninstalling LINQ to Twitter via console command, and installing/uninstalling ...
LINQ und ArcObjects Motivation LINQ1 (language integrated query) ist eine Komponente des Microsoft .NET Frameworks seit der Version 3.5. Es erlaubt eine SQL-ähnliche Abfrage zu verschiedenen Datenquellen wie SQL, XML u.v.m. Wie auch SQL bietet LINQ dazu eine deklarative Notation der Problemlösung - d.h. man muss nicht im Detail beschreiben, wie eine Aufgabe, sondern was überhaupt zu lösen ist. Das befreit den Entwickler abfrageseitig von fehleranfälligen Iterator-Konstrukten. Ideal wäre es, natürlich ...
In this Issue: András Velvárt, WIndowsPhoneGeek(-2-), Jesse Liberty(-2-), Victor Gaudioso, Kunal Chowdhury, Jeremy Likness, Michael Crump, and Dhananjay Kumar. Above the Fold: Silverlight: "Application Library Caching in Silverlight 4" Kunal Chowdhury WP7: "Handling WP7 orientation changes via Visual States" András Velvárt Shoutouts: Joe McBride gave a MEF Head User Group presentation and has posted How to Become a MEF Head – Slides & Code From SilverlightCream.com: Handling WP7 orientation changes ...