Giter VIP home page Giter VIP logo

cadru's Introduction

Scott Dorman

Microsoft MVP, Software Architect, Developer, Author, Speaker


          resumé              


I've worked with computers professionally since 1993. Although my primary focus is commercial software applications, I enjoy building infrastructure components and reusable shared libraries. I help companies define, develop, and automate processes, code standards, and guidelines.


1559       1559       sdorman       scott_dorman       scottdorman       https://feeds.feedburner.com/scottdorman

Codestyle.co     Languagespecs.info    

feedback

Buy Me A Coffee

GitHub Sponsor

cadru's People

Contributors

dependabot[bot] avatar gitter-badger avatar scottdorman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cadru's Issues

Support more fluent unit test assertions

Update Cadru.UnitTest.Framework to support using more fluent extension methods on the standard MS Test Assert (and related) classes. This will keep unit testing code more consistent, so you don't have to know when to use a Cadru specific class (like ConditionAssert) to write code like

var int i1 = 5;
var int i2 = 4;
ConditionAssert.Greater(i1, i2);

Instead, just include the Cadru.UnitTest.Framework namespace and you can write it as

var int i1 = 5;
var int i2 = 4;
Assert.That.Greater(i1, i2);

Create an IEqualityComparer{T} from a lambda

Some LINQ expressions, like Distinct don't accept lambdas but rather expect an instance of an IEqualityComparer<T>. It would be nice to provide a class that can encapsulate creating an IEqualityComparer<T> that uses a key selector function that can be passed in line to those LINQ expressions which expect one.

Add a strongly typed Enum helper class.

The standard Enum class in the framework provides a strongly typed TryParse method but not a strongly typed Parse method. Add a strongly typed Enum<T> class which provides a strongly typed Parse method and pass-through methods for the other methods of Enum (and strongly type those that can be).

Add addtional string extensions

The additional string extension methods need to be added:

  • bool EndsWithAny(this string source, IEnumerable<string> values)
  • bool EndsWithAny(this string source, IEnumerable<string> values, StringComparison comparisonType)
  • bool EqualsAny(this string source, IEnumerable<string> values)
  • bool EqualsAny(this string source, IEnumerable<string> values, StringComparison comparisonType)
  • bool StartsWithAny(this string source, IEnumerable<string> values)
  • bool StartsWithAny(this string source, IEnumerable<string> values, StringComparison comparisonType)

Add DateTime and DateTimeOffset extension to format as relative string

Add a new extension method to DateTime and DateTimeOffset that returns a string representation of the date as a relative string.

For example, DateTime.Today.ToRelativeDateString() should return Today, 12:00 AM, DateTime.Today.AddDays(-1).ToRelativeDateString() should return Yesterday and so on.

CountryCodes enum needs display attributes

The CountryCodes enum in Cadru.Core needs Display, EnumDescription, and UIHint attributes. This requires updating the projects to support .NET Standard 1.1 as the minimum.

Add an easy way to retrieve localized strings.

Localization attributes, such as DisplayAttribute provide an easy mechanism to retrieve a localized value, but DisplayAttribute is sealed and the LocalizableString class is internal. Provide something similar to LocalizableString so other attributes can be made localization aware easily.

Add additional overloads for LeftSubstring and RightSubstring

The LeftSubstring and RightSubstring methods should have additional overloads for extracting a substring indexed by char that allows the indexing character value to be excluded or included. The default should be that the character is included.

AppVeyor builds failing

The AppVeyor builds are failing because it's not targeting C#6. The .sln file has # Visual Studio 14 header (not # Visual Studio 2013); otherwise AppVeyor will force MSBuild 12.0.

Cadru.Data.Tests failing

The unit test in Cadru.Data.Tests is failing because it relies on a local file. Need to figure out how to do this through AppVeyor.

Add methods to Enum(T) and EnumExtensions to get a description.

Enum should have methods to retrieve the value of an EnumDescription attribute applied to an Enum member. It should also have a method which returns a collection of descriptions.

Similarly, the GetDescription method in EnumExtensions should be updated to behave in a similar manner as the one in Enum.

Refactor Cadru.AspNetCore namespaces

The namespaces in Cadru.AspNetCore still refer to it as Cadru.AspNet and need to be refactored to more closely match the Microsoft.AspNetCore namespaces.

Expand literals used by TryParseAsBoolean

The BoleanExtensions.TryParseAsBoolean extension method currently only supports the following literals:

  • False - false, f, no, n
  • True - true, t, yes, y

The literals should be expanded to:

  • False - false, f, no, n, 0, na, n/a
  • True - true, t, yes, y, 1

Add a Range(T) class.

Add a class which allows easy creation of a range of values. The range should be similar to a mathematical interval and should be able to include or exclude either endpoint (using standard interval notation), provide intersection and union operations, and be enumerable using a default enumeration function or a custom function.

Existing query string parameters should be preserved.

When adding query string parameters to a UriBuilder's QueryParameters dictionary, any existing parameters should be preserved.

The QueryStringParametersDictionary should gain an additional constructor which allows an existing query string to be passed in. The Query property should also be settable.

ExcelDataReader throwing a NullReferenceException

When the ExcelDataReader tries to access a field that is a nullable DateTime field and the original value comes in as an empty string, the parsing fails and throws a NullReferenceException rather than returning a null value.

Add a Partition method for enumerables

Add a method which partitions an enumerable into a collection of smaller enumerable collections all of a certain size. This is different from Slice, which returns a segment, in that

int[] numbers = { 0, 30, 20, 15, 90, 85, 40, 75 };
var partitions = numbers.Partition(3).ToArray();

Assert.AreEqual(3, partitions.Length);
CollectionAssert.AreEqual(new[] { 0, 30, 20 }, partitions[0].ToArray());
CollectionAssert.AreEqual(new[] { 15, 90, 85 }, partitions[1].ToArray());
CollectionAssert.AreEqual(new[] { 40, 75 }, partitions[2].ToArray());

HttpExtensions needs a CreateMessage method

A CreateMessage extension method on HttpClient needs to be created so that a MessageRequest can be created with query string parameters. This allows a MessageRequest, and more specifically the Uri of the request to be easily created with query string parameters to get around the limitations of Uri and the HttpClient.GetAsync method.

Add HttpMessage serializers

Useful for debugging and logging purposes, add Json serializers for HttpResponseMessage and HttpRequestMessage.

Add HasCustomAttribute extension

Add an extension method HasCustomAttribute to Cadru.Core\Extensions\TypeExtensions which simplifies testing a type to test if it contains a custom attribute.

Drop support for CsvReader

While CsvReader had a good run, it makes more sense to use a dedicated CSV parser that is up to date. We're dropping the CsvReader, and all it's associated classes, in favor of using something like CsvHelper or TinyCsvParser

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.