Example #1
0
        public TenantApiModel GetByApi(Context context, SiteSettings ss)
        {
            var data = new TenantApiModel()
            {
                ApiVersion = context.ApiVersion
            };

            ss.ReadableColumns(noJoined: true).ForEach(column =>
            {
                switch (column.ColumnName)
                {
                case "TenantId": data.TenantId = TenantId; break;

                case "Ver": data.Ver = Ver; break;

                case "TenantName": data.TenantName = TenantName; break;

                case "Title": data.Title = Title.Value; break;

                case "Body": data.Body = Body; break;

                case "ContractSettings": data.ContractSettings = ContractSettings?.RecordingJson(); break;

                case "ContractDeadline": data.ContractDeadline = ContractDeadline.ToLocal(context: context); break;

                case "DisableAllUsersPermission": data.DisableAllUsersPermission = DisableAllUsersPermission; break;

                case "DisableStartGuide": data.DisableStartGuide = DisableStartGuide; break;

                case "LogoType": data.LogoType = LogoType.ToInt(); break;

                case "HtmlTitleTop": data.HtmlTitleTop = HtmlTitleTop; break;

                case "HtmlTitleSite": data.HtmlTitleSite = HtmlTitleSite; break;

                case "HtmlTitleRecord": data.HtmlTitleRecord = HtmlTitleRecord; break;

                case "Creator": data.Creator = Creator.Id; break;

                case "Updator": data.Updator = Updator.Id; break;

                case "CreatedTime": data.CreatedTime = CreatedTime.Value.ToLocal(context: context); break;

                case "UpdatedTime": data.UpdatedTime = UpdatedTime.Value.ToLocal(context: context); break;

                case "Comments": data.Comments = Comments.ToLocal(context: context).ToJson(); break;

                default:
                    data.Value(
                        context: context,
                        columnName: column.ColumnName,
                        value: Value(
                            context: context,
                            column: column,
                            toLocal: true));
                    break;
                }
            });
            return(data);
        }
        public TenantApiModel GetByApi(IContext context, SiteSettings ss)
        {
            var data = new TenantApiModel();

            ss.ReadableColumns(noJoined: true).ForEach(column =>
            {
                switch (column.ColumnName)
                {
                case "TenantId": data.TenantId = TenantId; break;

                case "Ver": data.Ver = Ver; break;

                case "TenantName": data.TenantName = TenantName; break;

                case "Title": data.Title = Title.Value; break;

                case "Body": data.Body = Body; break;

                case "ContractSettings": data.ContractSettings = ContractSettings?.RecordingJson(); break;

                case "ContractDeadline": data.ContractDeadline = ContractDeadline.ToLocal(context: context); break;

                case "LogoType": data.LogoType = LogoType.ToInt(); break;

                case "HtmlTitleTop": data.HtmlTitleTop = HtmlTitleTop; break;

                case "HtmlTitleSite": data.HtmlTitleSite = HtmlTitleSite; break;

                case "HtmlTitleRecord": data.HtmlTitleRecord = HtmlTitleRecord; break;

                case "Creator": data.Creator = Creator.Id; break;

                case "Updator": data.Updator = Updator.Id; break;

                case "CreatedTime": data.CreatedTime = CreatedTime.Value.ToLocal(context: context); break;

                case "UpdatedTime": data.UpdatedTime = UpdatedTime.Value.ToLocal(context: context); break;

                case "Comments": data.Comments = Comments.ToLocal(context: context).ToJson(); break;
                }
            });
            return(data);
        }