Dotnet Support#36
Conversation
a47f714 to
49fbd2e
Compare
| [GeneratedCode("nex-gen", null)] | ||
| public sealed class NexusResult<TOk, TErr> | ||
| { | ||
| private NexusResult(bool isOk, TOk? ok, TErr? err) | ||
| { | ||
| IsOk = isOk; | ||
| Ok = ok; | ||
| Err = err; | ||
| } | ||
|
|
||
| public bool IsOk { get; } | ||
| public TOk? Ok { get; } | ||
| public TErr? Err { get; } | ||
|
|
||
| public static NexusResult<TOk, TErr> FromOk(TOk value) => new(true, value, default); | ||
| public static NexusResult<TOk, TErr> FromErr(TErr value) => new(false, default, value); | ||
| } |
There was a problem hiding this comment.
Not a huge deal here and I think we discussed this already, but have you considered moving NexusResult into TemporalSupport? Relevant to Golang since I think we'll need to generate some of our own helper types there too.
There was a problem hiding this comment.
I have to take a look at this one. It doesn't exist in the workflow service I've been paying the most attention to since it is the current application.
| public sealed class Email : NotificationTarget | ||
| { | ||
| public Email(string value) => Value = value; | ||
|
|
||
| public string Value { get; } | ||
| } |
| public string? Reason { get; set; } | ||
| } | ||
|
|
||
| public static partial class TypeShowcaseOperations |
There was a problem hiding this comment.
Idk if it matters, but I think we can rename this to Operations since it's already in the NexGen.TypeShowcase namespace
There was a problem hiding this comment.
And do we want to slap a [GeneratedCode] attribute on here too?
| internal class SetProfileRequest | ||
| { | ||
| internal SetProfileRequest(string userId, UserProfile profile) | ||
| { | ||
| UserId = userId; | ||
| Profile = profile; | ||
| } | ||
|
|
||
| public string UserId { get; } | ||
| public UserProfile Profile { get; } | ||
| } | ||
|
|
||
| [GeneratedCode("nex-gen", null)] | ||
| public class UserProfile |
There was a problem hiding this comment.
Why is SetProfileRequest internal while UserProfile isn't?
| ConsistencyToken = options.ConsistencyToken, | ||
| }; | ||
| return GetUserAsync(request); | ||
| } |
There was a problem hiding this comment.
GetUserOptions is identical to GetUserRequest, and this happens everywhere except when you use @nexus.function. Did you want to make the mandatory args of GetUserRequest into positional args so GetUserOptions only includes the options?
| public User UpdateEmail(string email) => throw new NotSupportedException("Resource methods require a bound Nexus client."); | ||
|
|
||
| public User Rename(string displayName) => throw new NotSupportedException("Resource methods require a bound Nexus client."); | ||
|
|
||
| public void Deactivate(string? reason) => throw new NotSupportedException("Resource methods require a bound Nexus client."); |
There was a problem hiding this comment.
Shouldn't these methods invoke the operations?
What was changed
Why?
Checklist
Closes
How was this tested: