Data conversion library for .NET

I created this project to simplify data conversion for a project I’m working on.

You can take code that looks like this

int output = 0; if(!int.TryParse("123"), out output) { throw new Exception("Couldn't parse it"); } 

and instead just say

int output = "123".ToInt(); 

This assumes you don’t care it if parses and if it doesn’t you want a 0. If you want a null to be returned you can say

int output = "123".ToNullableInt(); 

It’s made my code a lot cleaner and maybe you will find it useful too.

submitted by /u/Unexpectedpicard
[link] [comments]

Leave a Reply