Skip to content

Support [Range(Type, String, String)] #200

@dsdante

Description

@dsdante

The only way to define a range of a type other than int or double is to use the [Range(Type, String, String)] overload.

This raises a couple of questions:

  1. Should we support non-invariant cultures when generating SQL (not only here, but in other places too), e.g. decimal separators other than point or custom date formats?
  2. Should we throw more exceptions in case of invalid constraints like this?

So, I can think of a few ways to implement it:

  1. Let the user type anything in the range, only do a sanity check and pass the text literally to SQL.
  2. Convert the text to the specified type and then back to string.
  3. Same as # 2, but only support a few primitive types, to avoid differences in formats among cultures and DBMSes.

Which way should we do it, if at all?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions