Replies: 1 comment 3 replies
-
Hi @morganski - thanks for the kind words - I'm very pleased to hear that you're enjoying using Vogen! Nice to get feedback from another 80's fossil! :) Vogen does actually generate implicit (and explicit) converters. These are controlled by the However, for ASP.NET Core web apps, you don't need this as the ASP.NET runtime should just use the type converter that is generated by default. This tutorial explains how it works. I'd be interested to see if it doesn't work for you so that I can update it accordingly. |
Beta Was this translation helpful? Give feedback.
-
Steve,
First of all let me say how much I love using VoGen. I've been lusting after the capabilities of F# for a while, and now with VoGen I can indulge myself and rid the primitives from my code.
The one thing I feel is missing is a conversion operator to convert directly from (not to!) an integer to a VoGen generated type.
As an example, I have a strongly typed MemberId...
I'm using Blazor (but the same would be true for ASP.NET), where I have a route constraint as follows...
@page "/members/{member:int}"
Now, because there is no implicit operator to convert from int to MemberId, I can't define my backing property for this field as anything other than an int...
So then when I want to use this parameter in code, I have to convert it to a MemberId using MemberId.From(this.Member).
If there were a static implicit operator that did something like this...
I'd then be able to define my property as a MemberId and it would "just work". Well, I reckon it would.
I'm sure there may be good reasons why you have not included this in the code, but from my perspective this would make VoGen easier to use in many places. What do you think?
Thanks again for VoGen, it's excellent. I started on a ZX80 so you can keep your 6502 based 'puters. :-)
Beta Was this translation helpful? Give feedback.
All reactions