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 SomeDoc : Doc | |
{ | |
public Ref<AnotherDoc> TheOtherDoc { get; set; } | |
} | |
public class AnotherDoc : Doc | |
{ | |
public string Text { get; set; } | |
} |
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(...) | |
.Transport(t => t.UseRabbitMq(...) //< giver en RabbitMqOptions | |
.PrefetchCount(5)) |
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(....) | |
.(....) | |
.Behavior(b => b.IgnoreUnhandledMessages()) | |
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 |
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
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
> 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
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
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
begin transaction | |
delete 1000 rows | |
<---- why is it possibly for my other tx to get results about here? | |
insert bulk 1000 rows | |
commit transaction | |