Git Product home page Git Product logo

poem's Introduction

NuGet Version NuGet Downloads Build Codacy Badge Codacy Badge

Poem

Poem is a selection of useful extension methods that can be used to write fluent code. All Poem methods return one of the parameters to allow creating a chain of method calls.

Get started

Download from nuget.org:

PS> Install-Package Poem

Start using it right away!

Enumerable
    .Range(1, 4)
    .ForEach(Console.WriteLine); // <-- this comes from Poem!

// Output:
// 1
// 2
// 3

๐Ÿ”ด For more examples look here.

Improvements

Do you have an idea for a fluent extension method that would fit this package?

Great!

You can either:

  1. Fork this repo, add the method and raise a pull request. We will work together to get it merged! ๐Ÿ˜‰
  2. Create an issue explaining the extension method, where and how it would be used. We will work together on designing it and then someone (probably I) will implement the method.

Icon by smashicons.

poem's People

Contributors

lawrence-laz avatar

Stargazers

 avatar

Watchers

 avatar  avatar

poem's Issues

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).

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.

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)

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_").

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.