Skip to content

Get SQL data type string #1

@seanfisher

Description

@seanfisher

Is there a way to get the string for a datatype (VARCHAR(MAX)/INT/UNIQUEIDENTIFIER/etc)? For example, to construct a dynamic SQL string:

using (var context = new MyContext())
{
  var entityInfo = context.Db<MyEntity>();
  var dataType = entityInfo.Prop(a => a.MyProperty).[Something] ; // What to do here?
  var sql = $"CREATE TABLE MyEntity ( MyProperty {dataType} NULL);";
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions