Skip to content

Commit 657afb0

Browse files
committed
cleanup of readme and documentation
1 parent 5c0f9e3 commit 657afb0

File tree

14 files changed

+273
-108
lines changed

14 files changed

+273
-108
lines changed

README.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ ResultR is a lightweight request/response dispatcher for .NET applications. It r
2323
- No notifications or pub/sub messaging
2424
- No pipeline behaviors or middleware chains
2525
- No stream handling
26+
- No distributed messaging
2627

2728
This focused scope keeps the library small, fast, and easy to understand.
2829

@@ -54,6 +55,11 @@ ResultR prioritizes:
5455
- **Explicit over implicit**: Clear pipeline execution with predictable behavior
5556
- **Modern C# practices**: Leverages latest language features and patterns
5657

58+
## 📋 Requirements
59+
60+
- .NET 10.0 or later
61+
- C# 14.0 or later
62+
5763
## 📥 Installation
5864

5965
```bash
@@ -75,7 +81,7 @@ dotnet add package ResultR.Validation
7581
### 1. Define a Request
7682

7783
```csharp
78-
public record CreateUserRequest(string Email, string Name) : IRequest<User>;
84+
public record CreateUserRequest(string Email, string Name, int Age) : IRequest<User>;
7985
```
8086

8187
### 2. Create a Handler
@@ -115,7 +121,7 @@ public class CreateUserHandler : IRequestHandler<CreateUserRequest, User>
115121
public async ValueTask<Result<User>> HandleAsync(CreateUserRequest request, CancellationToken cancellationToken)
116122
{
117123
// Exceptions are automatically caught and converted to Result.Failure
118-
var user = new User(request.Email, request.Name);
124+
var user = new User(request.Email, request.Name, request.Age);
119125
await _repository.AddAsync(user, cancellationToken);
120126
return Result<User>.Success(user);
121127
}
@@ -284,6 +290,10 @@ public class ValidatingHandler : IRequestHandler<CreateOrderRequest, Order>
284290

285291
## ❓ FAQ
286292

293+
### Why ResultR?
294+
295+
ResultR prioritizes simplicity and explicitness over flexibility, giving you a focused request/handler pattern without the complexity of pipelines, behaviors, or middleware chains that you may never need. Every operation returns a unified Result or Result<T> type, making error handling consistent and predictable across your entire codebase. The optional inline hooks (ValidateAsync, BeforeHandleAsync, AfterHandleAsync) let you add cross-cutting concerns directly in your handlers without separate classes or DI registrations, keeping related logic together and reducing ceremony.
296+
287297
### Why "Dispatcher" instead of "Mediator"?
288298

289299
The classic GoF Mediator pattern describes an object that coordinates bidirectional communication between multiple colleague objects - think of a chat room where participants talk *through* the mediator to each other.
@@ -323,10 +333,17 @@ cd src/ResultR.Benchmarks
323333
dotnet run -c Release
324334
```
325335

326-
## 📋 Requirements
336+
## 💬 Support
327337

328-
- .NET 10.0 or later
329-
- C# 14.0 or later
338+
- **Issues**: [GitHub Issues](https://github.com/AlanBarber/ResultR/issues)
339+
- **Documentation**: [GitHub Wiki](https://github.com/AlanBarber/ResultR/wiki)
340+
341+
## 🔗 Links
342+
343+
- [GitHub Repository](https://github.com/AlanBarber/ResultR)
344+
- [ResultR on NuGet](https://www.nuget.org/packages/ResultR)
345+
- [ResultR.Validation on NuGet](https://www.nuget.org/packages/ResultR.Validation)
346+
- [ResultR.VSToolkit on VS Marketplace](https://marketplace.visualstudio.com/items?itemName=AlanBarber.ResultR-VSToolkit)
330347

331348
## 🤝 Contributing
332349

@@ -336,10 +353,6 @@ Contributions are welcome! Please feel free to submit a Pull Request.
336353

337354
ISC License - see the [LICENSE](https://github.com/AlanBarber/ResultR/blob/main/LICENSE) file for details.
338355

339-
## 💬 Support
340-
341-
- **Issues**: [GitHub Issues](https://github.com/AlanBarber/ResultR/issues)
342-
343356
---
344357

345358
Built with ❤️ for the C# / DotNet community.

docs/images/icon-32px.png

-385 Bytes
Loading

docs/wiki/Home.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ else
7878
### Optional Packages
7979

8080
- [ResultR.Validation](ResultR.Validation) - Inline validation with fluent API
81+
- [ResultR.VSToolkit](ResultR.VSToolkit) - Visual Studio extension for navigation and scaffolding
8182

8283
## Requirements
8384

docs/wiki/ResultR.VSToolkit.md

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
# ResultR VS Toolkit
2+
3+
Supercharge your ResultR development workflow with instant navigation from requests to handlers and one-click scaffolding of new request/handler pairs. The ResultR VS Toolkit is the essential companion extension for developers using the ResultR library.
4+
5+
## Installation
6+
7+
### From Visual Studio Marketplace
8+
9+
1. Open Visual Studio 2022
10+
2. Go to **Extensions****Manage Extensions**
11+
3. Search for "ResultR"
12+
4. Click **Download** and restart Visual Studio
13+
14+
### From GitHub Releases
15+
16+
1. Download the `.vsix` file from the [releases page](https://github.com/AlanBarber/ResultR/releases)
17+
2. Double-click to install
18+
3. Restart Visual Studio
19+
20+
## Requirements
21+
22+
- Visual Studio 2022 (17.0 or later)
23+
- Projects using the [ResultR](https://www.nuget.org/packages/ResultR) library
24+
25+
## Features
26+
27+
### Go to Handler Navigation
28+
29+
Instantly navigate from any `IRequest` or `IRequest<T>` type to its corresponding handler implementation.
30+
31+
#### How to Use
32+
33+
![Go to Handler Context Menu](images/go-to-handler-context-menu.png)
34+
35+
1. Place your cursor on any `IRequest` type (variable, parameter, or class definition)
36+
2. Use one of these methods:
37+
- **Keyboard**: Press `Ctrl+R, Ctrl+H`
38+
- **Context Menu**: Right-click and select **"Go to Handler..."**
39+
40+
#### What It Finds
41+
42+
The toolkit searches your entire solution for handlers that implement:
43+
- `IRequestHandler<TRequest>` for `IRequest` types
44+
- `IRequestHandler<TRequest, TResponse>` for `IRequest<TResponse>` types
45+
46+
It works across projects, so your handler can be in a completely different assembly.
47+
48+
#### Example
49+
50+
![Go to Handler Demo](images/go-to-handler-demo.gif)
51+
52+
```csharp
53+
// Place cursor on HelloWorldRequest and press Ctrl+R, Ctrl+H
54+
var request = new HelloWorldRequest();
55+
var result = await dispatcher.Dispatch(request);
56+
```
57+
58+
The toolkit will navigate to:
59+
60+
```csharp
61+
public class HelloWorldHandler : IRequestHandler<HelloWorldRequest>
62+
{
63+
public async ValueTask<Result> HandleAsync(HelloWorldRequest request, CancellationToken cancellationToken)
64+
{
65+
// Handler implementation
66+
}
67+
}
68+
```
69+
70+
### Scaffold Request/Handler Pairs
71+
72+
Quickly create new request and handler classes with proper namespaces and structure.
73+
74+
#### How to Use
75+
76+
1. In **Solution Explorer**, right-click on a project or folder
77+
2. Select **Add****ResultR Request / Handler...**
78+
3. Enter the request name (e.g., "HelloWorld")
79+
4. Click **Create**
80+
81+
![Add Request Handler Menu](images/add-request-handler-menu.png)
82+
83+
![Create Request Handler Dialog](images/create-request-handler-dialog.png)
84+
85+
![Scaffold Demo](images/scaffold-demo.gif)
86+
87+
#### What Gets Generated
88+
89+
The toolkit creates a single `.cs` file containing both the request and handler:
90+
91+
```csharp
92+
using ResultR;
93+
94+
namespace HelloWorldApp
95+
{
96+
public record HelloWorldRequest() : IRequest;
97+
98+
public class HelloWorldHandler : IRequestHandler<HelloWorldRequest>
99+
{
100+
public async ValueTask<Result> HandleAsync(HelloWorldRequest request, CancellationToken cancellationToken)
101+
{
102+
throw new NotImplementedException();
103+
}
104+
}
105+
}
106+
```
107+
108+
#### Smart Namespace Detection
109+
110+
The toolkit automatically:
111+
- Detects your project's namespace conventions
112+
- Uses file-scoped namespaces if your project uses them
113+
- Uses block-scoped namespaces if that's your convention
114+
- Places the file in the correct folder with the correct namespace
115+
116+
## Keyboard Shortcuts
117+
118+
| Action | Shortcut |
119+
|--------|----------|
120+
| Go to Handler | `Ctrl+R, Ctrl+H` |
121+
122+
## Troubleshooting
123+
124+
### "No handler found" message
125+
126+
This can happen if:
127+
- The handler doesn't exist yet
128+
- The handler is in a project that isn't loaded
129+
- The handler doesn't implement the correct interface
130+
131+
### Navigation goes to wrong handler
132+
133+
Ensure your handler implements the exact interface for your request type. For example:
134+
- `GetUserRequest : IRequest<User>` should have a handler implementing `IRequestHandler<GetUserRequest, User>`
135+
136+
### Scaffold menu item not visible
137+
138+
The "ResultR Request / Handler..." menu item only appears when you right-click on:
139+
- A C# project
140+
- A folder within a C# project
141+
142+
## Links
143+
144+
- [ResultR on NuGet](https://www.nuget.org/packages/ResultR)
145+
- [ResultR.Validation on NuGet](https://www.nuget.org/packages/ResultR.Validation)
146+
- [VS Marketplace](https://marketplace.visualstudio.com/items?itemName=AlanBarber.ResultR-VSToolkit)
147+
- [GitHub Repository](https://github.com/AlanBarber/ResultR)
148+
- [Report Issues](https://github.com/AlanBarber/ResultR/issues)
52.5 KB
Loading
53.1 KB
Loading
72 KB
Loading
4.79 MB
Loading

docs/wiki/images/scaffold-demo.gif

7.21 MB
Loading
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# ResultR VS Toolkit
2+
3+
Supercharge your [ResultR](https://github.com/AlanBarber/ResultR) development workflow with instant navigation from requests to handlers and one-click scaffolding of new request/handler pairs. The ResultR VS Toolkit is the essential companion extension for developers using the [ResultR](https://github.com/AlanBarber/ResultR) library.
4+
5+
## Features
6+
7+
### ⚡Navigate Your Codebase Instantly
8+
9+
Tired of hunting through your solution to find the handler for a request? The ResultR VS Toolkit makes navigation effortless! Simply place your cursor on any IRequest type - whether it's a variable, parameter, or class definition - and press Ctrl+R, Ctrl+H (or right-click and select "Go to Handler..."). The toolkit instantly locates and opens the corresponding IRequestHandler implementation, even if it's in a completely different project. No more manual searching, no more wasted time. Just click and you're there!
10+
11+
### 📝 Scaffold New Request/Handler Pairs
12+
13+
Creating new request/handler pairs has never been easier! Right-click on any project or folder in Solution Explorer and select "ResultR Request / Handler..." from the Add menu. Enter your request name, and the toolkit generates a properly structured .cs file with the correct namespace (automatically detecting whether you use file-scoped or block-scoped namespaces), all the necessary using statements, and a ready-to-implement handler class. The generated code follows your project's existing conventions, so it fits right in with your codebase. Spend less time on boilerplate and more time on what matters - your business logic!
14+
15+
## Requirements
16+
17+
- Visual Studio 2022 (17.0 or later)
18+
- Projects using the [ResultR](https://github.com/AlanBarber/ResultR) library
19+
20+
## Installation
21+
22+
1. Download the `.vsix` file from the [releases page](https://github.com/AlanBarber/ResultR/releases)
23+
2. Double-click to install
24+
3. Restart Visual Studio
25+
26+
Or search for "ResultR" in the Visual Studio Extensions marketplace.
27+
28+
## ❓ Why ResultR VS Toolkit?
29+
30+
The ResultR VS Toolkit provides a simple way to navigate between `IRequest`/`IRequest<T>` classes and their corresponding `IRequestHandler` implementations. It also provides a scaffold for creating new request/handler pairs. It's the perfect companion to the [ResultR](https://github.com/AlanBarber/ResultR) library!
31+
32+
## 💬 Support
33+
34+
- **Documentation**: [GitHub Wiki](https://github.com/AlanBarber/ResultR/wiki/ResultR.VSToolkit)
35+
- **Issues**: [GitHub Issues](https://github.com/AlanBarber/ResultR/issues)
36+
37+
38+
## 🔗 Links
39+
40+
- [GitHub Repository](https://github.com/AlanBarber/ResultR)
41+
- [ResultR on NuGet](https://www.nuget.org/packages/ResultR)
42+
- [ResultR.Validation on NuGet](https://www.nuget.org/packages/ResultR.Validation)
43+
- [ResultR.VSToolkit on VS Marketplace](https://marketplace.visualstudio.com/items?itemName=AlanBarber.ResultR-VSToolkit)
44+
45+
## 🤝 Contributing
46+
47+
Contributions are welcome! Please feel free to submit a Pull Request.
48+
49+
## 📄 License
50+
51+
ISC License - see the [LICENSE](https://github.com/AlanBarber/ResultR/blob/main/LICENSE) file for details.
52+
53+
---
54+
55+
Built with ❤️ for the C# / DotNet community.

0 commit comments

Comments
 (0)