Beispiel #1
0
 public ObjectField(IFieldPropertyFactory fieldPropertyFactory, FieldAttribute fieldAttribute)
 {
     if (fieldAttribute != null && fieldAttribute.SpecificDataType != null)
     {
         _specificFieldDefition = fieldPropertyFactory.Create(fieldAttribute.SpecificDataType, fieldAttribute);
     }
 }
Beispiel #2
0
        public virtual object ToSqlValue(object item)
        {
            var  instanceValue = GetEntityValue(item);
            bool needToUpdateInstance;
            var  result = FieldProperties.ToSqlValue(instanceValue, out needToUpdateInstance);

            if (needToUpdateInstance)
            {
                var objectValue = Convert(result);
                SetEntityValue(item, objectValue);
            }

            return(result);
        }
Beispiel #3
0
 protected virtual string GetFieldCreationAttributes()
 {
     return(FieldProperties.GetFieldCreationAttributes());
 }
Beispiel #4
0
 public object Convert(object value)
 {
     return(FieldProperties.Convert(value));
 }
Beispiel #5
0
 public virtual string GetFieldDefinition()
 {
     return($"[{FieldName}] {FieldProperties.GetDefinition()}{GetFieldCreationAttributes()}");
 }