From 8fa1d691c6b7882c65f85d7147c52c0b5edf5ef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81s=20Moschini?= Date: Wed, 26 Jan 2022 16:30:55 -0300 Subject: [PATCH] refactor: refactor ContentRow into a record in place of a class --- Doppler.HtmlEditorApi/Infrastructure/ContentRow.cs | 10 +--------- Doppler.HtmlEditorApi/Infrastructure/Repository.cs | 4 ++-- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/Doppler.HtmlEditorApi/Infrastructure/ContentRow.cs b/Doppler.HtmlEditorApi/Infrastructure/ContentRow.cs index 04fc0641..cc9d4ee6 100644 --- a/Doppler.HtmlEditorApi/Infrastructure/ContentRow.cs +++ b/Doppler.HtmlEditorApi/Infrastructure/ContentRow.cs @@ -1,9 +1 @@ -using Doppler.HtmlEditorApi.Model; - -public class ContentRow -{ - public string Content { get; set; } - public string Meta { get; set; } - public int IdCampaign { get; set; } - public int EditorType { get; set; } -} +public record ContentRow(string content, string meta, int idCampaign, int editorType); diff --git a/Doppler.HtmlEditorApi/Infrastructure/Repository.cs b/Doppler.HtmlEditorApi/Infrastructure/Repository.cs index ff9e0b33..7e1745f8 100644 --- a/Doppler.HtmlEditorApi/Infrastructure/Repository.cs +++ b/Doppler.HtmlEditorApi/Infrastructure/Repository.cs @@ -30,11 +30,11 @@ public async Task GetCampaignModel(string accountName, int camp return null; } - using var doc = JsonDocument.Parse(result.Meta); + using var doc = JsonDocument.Parse(result.meta); return new CampaignContent( meta: doc.RootElement, - htmlContent: result.Content); + htmlContent: result.content); } }