public int GetFieldLength(EntityDefinition e, EntityDefinitionProperty p) { List <ColumnAnnotation> annotations = context.Annotations.FindAll(annotation => annotation.EntityName == e.Name); ColumnAnnotation column = annotations.Find(a => a.PropertyName == p.PropertyName); if (column != null) { return(column.FieldLength); } return(-1); }
public bool IsFileType(EntityDefinition e, EntityDefinitionProperty p) { List <ColumnAnnotation> annotations = context.Annotations.FindAll(annotation => annotation.EntityName == e.Name); ColumnAnnotation column = annotations.Find(a => a.PropertyName == p.PropertyName); if (column != null) { return(column.HoldsFile); } return(false); }
public bool IsEnumType(EntityDefinition e, EntityDefinitionProperty p, ref Dictionary <int, string> values) { List <ColumnAnnotation> annotations = context.Annotations.FindAll(annotation => annotation.EntityName == e.Name); ColumnAnnotation column = annotations.Find(a => a.PropertyName == p.PropertyName); if (column != null) { if (column.IsEnum) { values = column.EnumValues; return(true); } } return(false); }