This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static readonly object GeneratorLock = new object(); | |
///<summary> | |
/// Create the next id (numeric) | |
///</summary> | |
private int NextAccountNumber() | |
{ | |
lock (GeneratorLock) | |
{ | |
using (new TransactionScope(TransactionScopeOption.Suppress)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is a hacky sample (that works for me) of alternative way to use Lokad-codeDSL | |
// or any similar way of generating message contracts on-the-fly. Original approach was | |
// with using T4 template, that would rebuild cs files from DSL representation, whenever | |
// we hit Ctrl-S. | |
// This approach works almost exactly like this (Ctrl-S to rebuild), but does not require VS | |
// to run or does not require unloading VS to change the underlying generator code. | |
// in fact it is extremely boring. Lolcats from MightyMoose could be used to improve the situation, though. | |
// any takers? :) |
NewerOlder