Skip to content

Commit

Permalink
Add max length annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
sersoft-intern committed Apr 23, 2024
1 parent 8d77d8e commit 60343cd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/SensorServer/Models/Measurement.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.ComponentModel.DataAnnotations;
using Microsoft.EntityFrameworkCore;
using SensorServer.Helpers;

Expand All @@ -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();
Expand Down

0 comments on commit 60343cd

Please sign in to comment.