Giter Site home page Giter Site logo

lawrence-laz / poem Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 75 KB

A selection of useful extension methods to write fluent code.

License: MIT License

C# 100.00%
csharp dotnet dotnet-standard extension-methods fluent fluent-design utilities utils

poem's Introduction

Hi there ๐Ÿ‘‹

lawrence-laz's GitHub stats

poem's People

Contributors

lawrence-laz avatar

Stargazers

 avatar

Watchers

 avatar  avatar

poem's Issues

Dictionary get or add

Sometimes dictionary is a just a part of a compound structure. In such cases a method like .GetOrAdd(TKey, Func<TVal>) would be useful.

Something like ensure prefix.

Sometimes you have a set of data that should be prefixed with some string, but not all entries are. Add a method that easily handles this. Something like string.EnsurePrefix("Prefix_").

Conditional action

Sometimes we have a LINQ chain that check's something and we want to execute an action depending on the boolean value the LINQ returns. This could be achieved with something like static bool IfTrue(this bool value, Action action).

Set all items on array

There's sometimes a need to set all array values to one specific value. There should be an extension method targeting arrays that does this. Something like:
SetAll<T>(this T[] array, T value)

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.