Esempio n. 1
0
 /// <summary>
 /// Helper to select the correct attribute property to send as a DefaultValue annotation value
 /// </summary>
 /// <param name="self"></param>
 /// <returns></returns>
 public static object GetDefaultValueAttributeValue(this EFExtensions.DefaultValueAttribute self)
 {
     return(String.IsNullOrWhiteSpace(self.DefaultSql) ? self.Value : self.DefaultSql);
 }
Esempio n. 2
0
 /// <summary>
 /// Helper to select the correct DefaultValue annotation key based on the attribute values
 /// </summary>
 /// <param name="self"></param>
 /// <returns></returns>
 public static string GetDefaultValueAttributeKey(this EFExtensions.DefaultValueAttribute self)
 {
     return(String.IsNullOrWhiteSpace(self.DefaultSql) ? DefaultValueConvention.DirectValueAnnotationKey : DefaultValueConvention.SqlValueAnnotationKey);
 }