Skip to content

Provides consistent, strongly-typed generic return objects throughout different layers of an application, from database queries in repositories to service-level operations

License

vpetkovic/OperationResult

Repository files navigation

Build and Push NuGet Package

Package NuGet Version Stats
OperationResult.Core Install-Package OperationResult.Core Nuget Nuget

OperationResult

Provides consistent, strongly-typed generic return objects throughout different layers of an application, from database queries in repositories to service-level operations

Usage Example

public record User(string name);

OperationResult<User> createdUser = await OperationResultExtensions.TryOperationAsync<User>(async () => 
{
  var user = new User("John");
  
  await _someDbContext.Users.Add(user);
  await _someDbContext.SaveChangesAsync();
  
  return (user, default);
}, onException => Rollback());
  • Add More usage examples

About

Provides consistent, strongly-typed generic return objects throughout different layers of an application, from database queries in repositories to service-level operations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages