Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chaining clauses #177

Open
figueiredorj opened this issue Jan 23, 2022 · 6 comments
Open

Chaining clauses #177

figueiredorj opened this issue Jan 23, 2022 · 6 comments

Comments

@figueiredorj
Copy link

hi @danielwertheim ,
the concept is very good and did already kne it.. just did not tried to look for or developed one my self...

When I saw you have chaining in this it was top... however seems to lack support for properly chaining.. returning void or string or else does not make any sense.. please make all entities return type of Param.

If you need help with this extra work let me know.. I wouldn't mind helping you making this more usable :)

@ndrwrbgs
Copy link
Contributor

ndrwrbgs commented Jan 2, 2023

It looks like it’s chainable per the documentation: https://github.com/danielwertheim/Ensure.That

Could you include a code snippet you’d expect would work which does not?

@figueiredorj
Copy link
Author

sorry... meanwhile at work didn't noticed this....
now don't remember the use case I was facing...

@eNTi
Copy link

eNTi commented Apr 27, 2023

I'd like to know this too. How is this supposed to work?

@erzki
Copy link

erzki commented Jan 24, 2024

The simple example that is presented in the documentation doesn't work from version 6+. It was working in version 5.

Ensure
  .That(myString)
  .IsNotNullOrWhiteSpace()
  .IsGuid();

The problem is that IsNotNullOrWhiteSpace is void and doesn't return a Param.

This is a bit of a deal breaker for us actually because we do a lot of chaining with Ensure.That.

@erzki
Copy link

erzki commented Jan 24, 2024

@danielwertheim I see in the source code that it actually returns StringParam to make it chainable but not in the latest version on nuget. Do you have any plans to release a new version?

@ndrwrbgs
Copy link
Contributor

ndrwrbgs commented Mar 7, 2024

@erzki it looks like https://www.nuget.org/packages/Ensure.That/11.0.0-p3 was published after the change was made and is on nuget, could you try that version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants