Site
Web
Home
Community
My Wall
Social Summary
Social Members
Social Profile
Social Group Directory
Social Group Details
About
LightSwitch Articles on C# Corner
Harold Glenn P Minerva Articles
LightSwitch Articles on Tek Freak
LightSwitch Articles on Jan Van der Haegen
LightSwitchFX
Blog
Forum
Downloads
Market
Amazon Store
Themes
JetFlow Themes
JetStreamBright Themes
JetStream Themes
JetPack Themes
Enterprise Themes
Business Themes
Designer Themes
Expression Themes
Shiny Themes
Shells
Minimal Shell
DELORDSON Shells
OutlookBar Shell
Shell Pack
TreeView Shell
Touch Strip Menu Shell
Tiled Menu Shell
Tabbed Menu Shell
Default Shell Top 2012
Default Shell
Default Shell 2012
Books
Creating Visual Studio LightSwitch Custom Controls
OData And Visual Studio LightSwitch
Visual Studio Gallery
Demos
Things For Sale
Call Log
Tank Game
Expense Report
You are here:
Blog
Register
|
Login
New To LightSwitch?
Start With
The Tutorial At
This Link
All Blogs
Bilal Haidar
Bill Mason
DELORDSON
LightSwitch Help Website
Mihail Mateev LightSwitch Blog
Richard Waddell
Switching the Lights
The Power of LightSwitch
Keywords
Phrase
Topics
HTML Client (17)
OData (16)
Advanced (14)
Applications (14)
Custom Controls (12)
Control Extensions (11)
WCF RIA Service (11)
Beginner (10)
Extensions (9)
MVVM (9)
HTML Client (beta Version) (8)
Intermediate (6)
LightSwitch 11 (6)
Concepts (4)
DotNetNuke (4)
Book Excerpts (3)
Printing (3)
Reporting (3)
Student Information System (3)
Data Grid (2)
Themes (2)
App Inventor (1)
Community (1)
Debugging (1)
Design (1)
Dynamic SQL (1)
ExcelImporter (1)
Extensibility (1)
Installation (1)
Interviews (1)
LightSwitch (1)
OLAP (1)
Shells (1)
Stored Procedures (1)
Templates (1)
Archive
Archive
<
November 2011
>
Sun
Mon
Tue
Wed
Thu
Fri
Sat
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
10
Monthly
May, 2013 (10)
April, 2013 (8)
March, 2013 (1)
February, 2013 (6)
January, 2013 (2)
December, 2012 (6)
November, 2012 (7)
September, 2012 (1)
August, 2012 (2)
July, 2012 (9)
June, 2012 (4)
May, 2012 (4)
April, 2012 (10)
March, 2012 (8)
February, 2012 (9)
January, 2012 (8)
December, 2011 (7)
November, 2011 (4)
October, 2011 (7)
September, 2011 (6)
August, 2011 (6)
July, 2011 (5)
June, 2011 (5)
May, 2011 (11)
April, 2011 (3)
March, 2011 (1)
September, 2010 (4)
August, 2010 (2)
Latest Microsoft LightSwitch Blogs
Visual Studio LightSwitch Team Blog
OData Apps in Update 2 - Querying Data from Stack
5/23/2013 6:53 AM
Read more...
Creating a wizard-like experience for HTML client
5/16/2013 8:00 AM
Read more...
Customizing the SharePoint Chrome Control in
5/14/2013 8:07 AM
Read more...
Announcing Runtime Update 1 - Supporting
5/7/2013 9:00 AM
Read more...
ASP.NET SignalR and LightSwitch (Matt Sampson)
5/3/2013 6:07 AM
Read more...
Localizing a LightSwitch Application (Heinrich
5/2/2013 10:04 AM
Read more...
Publishing LightSwitch apps for SharePoint to the
4/29/2013 8:11 AM
Read more...
Dashboard Reports with LightSwitch, WebAPI and
4/25/2013 8:04 AM
Read more...
Create Dashboard Reports with LightSwitch, WebAPI
4/22/2013 9:38 AM
Read more...
Using the LightSwitch ServerApplicationContext API
4/15/2013 11:44 AM
Read more...
Auditing and Concurrency don’t mix (easily)…
By Kostas Christodoulou on
Sunday, November 20, 2011
In MSDN forums I came across a
post
addressing an issue I have also faced. Auditing fields can cause concurrency issues in LightSwitch (not exclusively).
In general basic auditing includes keeping track of when an entity was created/modified and by whom. I say basic auditing because auditing is in general much more than this.
Anyhow, this basic auditing mechanism is very widely implemented (it’s a way for developers to be able to easily find a user to blame for their own bugs :-p), so let’s see what this can cause and why in LightSwitch.
In the aforementioned post but also in this
one
, I have clearly stated that IMHO the best way to handle concurrency issues is using RIA Services. If you don’t, read what follows.
Normally in any application, updating the fields that implement Audit tracking would be a task completed in the business layer (or even Data layer in some cases and this could go as deep as a database trigger). So in LightSwitch the first place one would look into to put this logic would be EntityName_Inserting and EntityName_Updating partial methods that run on the server. Which is right, but causes concurrency issues, since after saving the client instance of the entity is not updated by the changes made at the server and as soon as you try to save again this will cause concurrency error.
So, what can you do, apart from refreshing after every save which is not very appealing? Update at the client. Not appealing either but at least it can be done elegantly:
Let’s say all entities to implement auditing have 4 fields:
DateCreated CreatedBy DateModified ModifiedBy Add to the Common project a new interface called IAuditable like below:
namespace LightSwitchApplication{...
Read More »
Comments (0)
Switching the Lights
LightSwitch Chat Application Using A Data Source Extension
By Michael Washington on
11/19/2011 7:15 PM
In this article we will create a simple chat application. If different users are using the same LightSwitch application, they will be able to chat with each other.
...
PermaLink
Read More »
Comments (6)
LightSwitch Help Website
CLASS Extensions. Making of (the end)
By Kostas Christodoulou on
Tuesday, November 08, 2011
If you have installed
CLASS Extensions
you know that there are two different controls that are used to handle Color business type. The ColorPicker and the ColorViewer. If you have read the
previous post
of the series you know that behind the scenes, each one of these controls is a wrapper for 2 other controls. The ColorPicker is for editing whereas ColorViewer is used for viewing only. The reason of exposing 2 different controls was that I didn’t manage to correctly retrieve the information about the content being read-only and changing dynamically the behavior of the controls.
If you browse the code you will see in _Load and other places (be kind, I was desperate) the attempt to bind to IsReadOnly property of the DataContext.
What I wanted to achieve was to...
Read More »
Comments (1)
Switching the Lights
Connecting To A .CSV or Excel File Directly With LightSwitch
By Michael Washington on
11/3/2011 8:23 PM
Sometimes we are faced with the need to read data from a .csv (comma separated value) or Excel file. One option is to import the data, but this can turn out to be more trouble than any benefit if the file changes frequently.
Using
WCF RIA Services
allows the option to place the .csv or Excel file on the server hard drive and have LightSwitch access the data directly. When the file changes, simply...
Read More »
Comments (7)
LightSwitch Help Website
Microsoft Visual Studio is a registered trademark of Microsoft Corporation / LightSwitch is a registered trademark of Microsoft Corporation
Privacy Statement
|
Terms Of Use
Copyright 2011 by Michael Washington