This file contains 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
static readonly Regex TagsRegex = new Regex(@"(?:(?<=\s)|^)#(\w*[A-Za-z_]+\w*)"); | |
static readonly Regex MentionsRegex = new Regex(@"(?:(?<=\s)|^)\@(\w*[A-Za-z_]+\w*)"); |
This file contains 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
var adapter = new MyContainerAdapter(favoriteContainer); | |
Configure.With(adapter) | |
.Transport(t => t.UseMsmq("some_input_queue")) | |
.Serialization(s => s.UseJsonSerializer()) | |
.Sagas(s => s.StoreInSqlServer(connectionstring, "saga_table", "saga_index_table")) | |
.Subscriptions(s => s.StoreInSqlServer(connectionstring, "subscriptions")) | |
.SpecifyOrderOfHandlers(h => h.First<SomeType>().Then<AnotherType>()) | |
.Logging(l => l.Log4Net()) | |
.DetermineEndpoints(d => d.FromRebusMappingsSection()) |
This file contains 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
[Test] | |
public void AssertIgnorance() | |
{ | |
var ignoredTestCases = Assembly.GetExecutingAssembly().GetTypes() | |
.SelectMany(t => t.GetMethods()) | |
.Where(m => m.GetCustomAttributes(typeof (IgnoreAttribute), false).Any()) | |
.ToList(); | |
Assert.That(ignoredTestCases.Any(), Is.False, @"The following tests have been IGNORED: |
This file contains 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
begin transaction | |
delete 1000 rows | |
<---- why is it possibly for my other tx to get results about here? | |
insert bulk 1000 rows | |
commit transaction | |
This file contains 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
public class SomeRegistry : StructureMap.Configuration.DSL.Registry | |
{ | |
public SomeRegistry() | |
{ | |
For<ISomething>().Singleton().Use<SomeImplementation>(); | |
For<IDit>().Singletong().Use<Dat>(); | |
// osv.... | |
// og så: |
This file contains 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
Configure.With(adapter) | |
.Transport(t => t.UseMsmqWithSubqueues()) | |
.CreateBus().Start(); | |
//... | |
<!-- old style: --> | |
<!-- <rebus inputQueue="someExplicitlyStatedInputQueue" errorQueue="someExplicitlyStatedErrorQueue"> --> | |
<!-- subq style ('input' and 'error' automagically created beneath this name): --> |
This file contains 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
> use test | |
switched to db test | |
> db.coll.save({firstName: "Mogens", address:{street: "Torsmark"}}) | |
> db.coll.find() | |
{ "_id" : ObjectId("506c8cbaac822bf4a75bd2c9"), "firstName" : "Mogens", "address" : { "street" : "Torsmark" } } | |
> db.coll.find({"firstName": "Mogens"}) | |
{ "_id" : ObjectId("506c8cbaac822bf4a75bd2c9"), "firstName" : "Mogens", "address" : { "street" : "Torsmark" } } | |
> db.coll.find({"firstName": "Mogens", "address.street": "Torsmark"}) | |
{ "_id" : ObjectId("506c8cbaac822bf4a75bd2c9"), "firstName" : "Mogens", "address" : { "street" : "Torsmark" } } |
This file contains 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
These two can be in the same handler: | |
public void Handle(SomethingInteresting msg) | |
{ | |
var correlationId = "possiblySomethingThatMakesSense"; | |
bus.Send(new SomeMessageThatKicksOffSomeProcess { CorrelationId = correlationId }); | |
bus.Defer(TimeSpan.FromMinutes(2), new VerifyThatAllExpectedRepliesWereReceived { CorrelationId = correlationId }); | |
} | |
public void Handle(VerifyThatAllExpectedRepliesWereReceived msg) |
This file contains 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
using(var conn = new SqlConnection("server=.;initial catalog=minDatabase;integrated security=sspi")) | |
{ | |
conn.Open(); | |
using(var cmd = conn.CreateCommand()) | |
{ | |
cmd.CommandText = "select something from whatever"; | |
using(var reader = cmd.ExecuteReader()) | |
{ |
This file contains 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
namespace DrugLord.Messages | |
{ | |
public class MakeDeposit | |
{ | |
public Money Money { get; set; } | |
public Drugs Drugs { get; set; } | |
public string SecretCode { get; set; } | |
} | |
public class Money |