Created
January 3, 2018 15:05
-
-
Save dgg/e00e1bd8f501685ac2de64f10c144a84 to your computer and use it in GitHub Desktop.
Anatomy-of-a-Breaking-Change
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 System; | |
using BreakingChangeAnatomy.Library; | |
using BreakingChangeAnatomy.Library.ChildNs; | |
namespace BreakingChangeAnatomy.Client | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var o = new TheType { TheProperty = 42m }; | |
var result = o.TheMethod(new TheArgument { Postfix = "!" }); | |
Console.WriteLine(result.Something); | |
Console.ReadLine(); | |
} | |
} | |
} |
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 BreakingChangeAnatomy.Library.ChildNs; | |
namespace BreakingChangeAnatomy.Library | |
{ | |
public class TheType | |
{ | |
public decimal TheProperty { get; set; } | |
public TheReturn TheMethod(TheArgument argument) | |
{ | |
// pretend doing something | |
var result = new TheReturn | |
{ | |
Something = $"{TheProperty} {argument.Postfix}" | |
}; | |
return result; | |
} | |
} | |
} |
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
├───Library | |
│ TheType.cs | |
│ | |
└───ChildNs | |
TheArgument.cs | |
TheReturn.cs |
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 BreakingChangeAnatomy.Library.ChildNs; | |
namespace BreakingChangeAnatomy.Library | |
{ | |
public class TheType | |
{ | |
public decimal TheProperty { get; set; } | |
public TheReturn TheMethod(TheArgument argument) | |
{ | |
// pretend doing something | |
var result = new TheReturn | |
{ | |
// compatible change | |
Something = $"{TheProperty}{argument.Postfix}" | |
}; | |
return result; | |
} | |
} | |
} |
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 BreakingChangeAnatomy.Library | |
{ | |
public class TheType | |
{ | |
public decimal TheProperty { get; set; } | |
} | |
} | |
namespace BreakingChangeAnatomy.Library.ChildNs | |
{ | |
public static class Operation | |
{ | |
public static TheReturn TheMethod(this TheType o, TheArgument argument) | |
{ | |
// fake doing something | |
var result = new TheReturn | |
{ | |
Something = $"{o.TheProperty}{argument.Postfix}" | |
}; | |
return result; | |
} | |
} | |
} |
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
├───Library | |
│ TheType.cs | |
│ | |
└───ChildNs | |
Operation.cs | |
TheArgument.cs | |
TheReturn.cs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment