You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could you kindly add the table column type ?
Thank you in advance.
Abdoessalam
My suggestion is :
To add Column type property - the column attribute in EF core is as follows :
Column Attribute: [Column (string name, Properties:[Order = int],[TypeName = string])
ex
[Column("DoB", Order = 1, TypeName="DateTime2")]
The suggested steps to add it :
a- open Craftsman\Models\EntityProperty.cs file, append the following property:
public string ColumnType { get; set; }
b- open Craftsman\Builders\EntityBuilder.cs file and replace the following:
if (!string.IsNullOrEmpty(entityProperty.ColumnName))
attributeString += @$" [Column(""{entityProperty.ColumnName}"",TypeName=""{entityProperty.ColumnType}"")]{Environment.NewLine}";
with the following:
if (!string.IsNullOrEmpty(entityProperty.ColumnName))
{
if (!string.IsNullOrEmpty(entityProperty.ColumnType))
attributeString += @$" [Column(""{entityProperty.ColumnName}"",TypeName=""{entityProperty.ColumnType}"")]{Environment.NewLine}";
else
attributeString += @$" [Column(""{entityProperty.ColumnName}"")]{Environment.NewLine}";
}
The text was updated successfully, but these errors were encountered:
Btw, if you're up for a PR it would be more than welcomed. Not sure how soon I'll get to this, but it should be a pretty low lift and good first ticket!
new property on EntityProperty
updating the attribute builder in the EntityBuilder class
Could you kindly add the table column type ?
Thank you in advance.
Abdoessalam
My suggestion is :
To add Column type property - the column attribute in EF core is as follows :
Column Attribute: [Column (string name, Properties:[Order = int],[TypeName = string])
ex
[Column("DoB", Order = 1, TypeName="DateTime2")]
The suggested steps to add it :
a- open Craftsman\Models\EntityProperty.cs file, append the following property:
b- open Craftsman\Builders\EntityBuilder.cs file and replace the following:
The text was updated successfully, but these errors were encountered: