예제 #1
0
        private string MethodsSeters(IEnumerable <Info> infos, TableInfo tableInfo)
        {
            var pathTemplateMethosSeters = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, this._defineTemplateFolder.Define(tableInfo), DefineTemplateName.EntityMethodSeters(tableInfo));
            var textTemplateMethosSeters = Read.AllText(tableInfo, pathTemplateMethosSeters, this._defineTemplateFolder);

            var _methods = string.Empty;

            foreach (var item in infos)
            {
                if (Audit.IsAuditField(item.PropertyName))
                {
                    continue;
                }

                if (!IsRequired(item))
                {
                    _methods += string.Format("{0}{1}", textTemplateMethosSeters.Replace("<#propertyName#>", item.PropertyName).Replace("<#propertyNameLower#>", item.PropertyName.ToLower()).Replace("<#type#>", item.Type), System.Environment.NewLine);
                }
            }

            return(_methods);
        }