From 60343cd36ffaba28b0939e5532cbbe110fd6cef5 Mon Sep 17 00:00:00 2001 From: David Blum Date: Tue, 23 Apr 2024 10:10:23 +0200 Subject: [PATCH] Add max length annotation --- server/SensorServer/Models/Measurement.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/SensorServer/Models/Measurement.cs b/server/SensorServer/Models/Measurement.cs index 70625e7..1f03904 100644 --- a/server/SensorServer/Models/Measurement.cs +++ b/server/SensorServer/Models/Measurement.cs @@ -1,3 +1,4 @@ +using System.ComponentModel.DataAnnotations; using Microsoft.EntityFrameworkCore; using SensorServer.Helpers; @@ -9,6 +10,7 @@ public class Measurement { public long? Id { get; set; } public DateTime Date { get; set; } + [MaxLength(128)] public string Location { get; set; } = null!; public double TemperatureCelsius { get; set; } public double TemperatureFahrenheit => TemperatureCelsius.ToFahrenheit();