protected override void Apply(DefaultValueAttribute attribute, IPropertyInstance instance) { if (!string.IsNullOrEmpty(attribute.Value)) { if (instance.Type == typeof(bool) || instance.Type == typeof(bool?)) { instance.Default(attribute.Value); } else { instance.Default(attribute.Value); } } }
private static bool ProcessDateTypes(IPropertyInstance instance) { if (instance.Type == typeof(DateTime)) { if (instance.Name.ToUpper().Contains("START") || instance.Name.ToUpper().Contains("CREATEDON")) { instance.Default("(getdate())"); instance.Not.Nullable(); } return(true); } return(false); }
public void Apply(IPropertyInstance instance) { instance.ReadOnly(); instance.Generated.Insert(); instance.Default("getDate()"); }
protected override void Apply(DefaultValueAttribute attribute, IPropertyInstance instance) { instance.Default(attribute.Value.ToString()); }