Exemplo n.º 1
0
        public void GenerateCode(IConceptInfo conceptInfo, ICodeBuilder codeBuilder)
        {
            ReferencePropertyInfo info = (ReferencePropertyInfo)conceptInfo;

            if (DataStructureCodeGenerator.IsTypeSupported(info.DataStructure))
            {
                var properties = GetReferenceProperties(_dslModel.Concepts, info);

                string lookupField   = "";
                var    lookupColumns = new List <string>();

                foreach (var prop in properties)
                {
                    lookupField = prop.Name;
                    lookupColumns.Add("\"" + prop.Name + "\"");
                }


                string lookupEntity = info.Referenced.Name;

                //string dodatniAtribut = string.Format(ReferenceFormat, _dslModel.Concepts.Count(), lookupEntity, String.Join(", ", lookupColumns));
                string dodatniAtribut = string.Format(ReferenceFormat, lookupField, lookupEntity, String.Join(", ", lookupColumns));



                MvcPropertyHelper.GenerateCodeForType(_dslModel, info, codeBuilder, "Guid?", "ID", dodatniAtribut);
            }
        }
Exemplo n.º 2
0
        public void GenerateCode(IConceptInfo conceptInfo, ICodeBuilder codeBuilder)
        {
            PropertyInfo info         = (PropertyInfo)conceptInfo;
            string       propertyType = GetPropertyType(info);

            if (!String.IsNullOrEmpty(propertyType) && DataStructureCodeGenerator.IsTypeSupported(info.DataStructure))
            {
                MvcPropertyHelper.GenerateCodeForType(_dslModel, info, codeBuilder, propertyType, "", DecimalFormat);
            }
        }
Exemplo n.º 3
0
        public void GenerateCode(IConceptInfo conceptInfo, ICodeBuilder codeBuilder)
        {
            PropertyInfo info         = (PropertyInfo)conceptInfo;
            string       propertyType = GetPropertyType(info);

            var hasMaxLength = _dslModel.Concepts.OfType <MaxLengthInfo>().Any(
                maxLength => maxLength.Property.Name == info.Name &&
                maxLength.Property.DataStructure.Name == info.DataStructure.Name &&
                maxLength.Property.DataStructure.Module.Name == info.DataStructure.Module.Name
                );

            string additionalTag = hasMaxLength ? "" : ShortStringFormat;

            if (!String.IsNullOrEmpty(propertyType) && DataStructureCodeGenerator.IsTypeSupported(info.DataStructure))
            {
                MvcPropertyHelper.GenerateCodeForType(_dslModel, info, codeBuilder, propertyType, "", additionalTag);
            }
        }