Exemple #1
0
        public virtual TypeUsageInfo GetSimplePropertyTypeInfo(IPropertyMetadata <TTable, TTableContent, TColumn, TColumnContent> data)
        {
            var column = data.Column;

            if (column.TypeInfo.IsValueType && !column.IsRequired)
            {
                return(TypeUsageInfo.CreateNullable(column.TypeInfo));
            }
            return(column.TypeInfo);
        }
Exemple #2
0
        internal static void AddExplicitProperty(PropertyInfo property, TypeUsageInfo iintervalfields, EntityInfo entity)
        {
            if (property.Type.IsNullable)
            {
                return;
            }
            var prop = new PropertyInfo(property.Name, TypeUsageInfo.CreateNullable(property.Type),
                                        new PropertyInvokerInfo(string.Format("return {0};", property.Name)),
                                        new PropertyInvokerInfo(string.Format("if(value.HasValue){0} = value.Value; else throw new ArgumentNullException(\"value\");", property.Name)));

            prop.ExplicitInterface = iintervalfields;
            entity.AddProperty(prop);
        }