Tags » C#

how to adapt C++-objects for TSX

TSX doesn’t recognize partial writes to objects as writes to the whole object. This can cause a missing synchronisation.

The fix is very easy: you mark an object as written. 42 more words

Computer

Default Equals in C#.Net for ValueTypes

The default Implementation of the obj.Equals(Obj1) is reference checking for reference types and reflection, bitwise equality for Value Types.

Value Types equality has three special cases: 72 more words

.Net C#

Entity Framework code first get migration sql

The command to use in the Package Manager Console is as follows:

Script-Migration fromMigration toMigration

The fromMigration is optional – will default to 0 ie no migrations have been applied… 13 more words

Csharp

Calculating an Exponential Back Off Delay Based on Failed Attempts

I implemented the following formula found on Wikipedia in C#.

private int GetExpectedBackoff(int numberOfFail)
{
return (int.Parse(Math.Pow(2, numberOfFail).ToString()) - 1) / 2;
}

C#