Closed GoogleCodeExporter closed 9 years ago
The problem with exposing it directly as Nullable<int> is that it doesn't have
any
way of passing the specified default value into the GetValueOrDefault; where-as
the
current implementation respects the default value if specified.
Fortunately, what you want is fully catered or as an option; add
"-p:detectMissing"
to the command line; this will give you a public bool idSpecified {...} that
tells
you whether it has an explicit value vs a default value.
Original comment by marc.gravell
on 10 Mar 2009 at 10:27
Original comment by marc.gravell
on 26 Jun 2009 at 7:23
I think that having optional fields translate to nullable is the way to go.
It's certainly more convenient.
I would vote for:
- nullables for all optional
- field getter could have special logic for the case when default value is
specified
- the codegen could output "isSpecified" for that special case
Original comment by filip.fr...@debesys.net
on 30 Jul 2012 at 4:33
Original issue reported on code.google.com by
nag...@gmail.com
on 10 Mar 2009 at 6:52