diff --git a/src/Nox.Generator/Application/Dto/EntityUpdateDto.template.cs b/src/Nox.Generator/Application/Dto/EntityUpdateDto.template.cs
index a99020720c..9cb19827d3 100644
--- a/src/Nox.Generator/Application/Dto/EntityUpdateDto.template.cs
+++ b/src/Nox.Generator/Application/Dto/EntityUpdateDto.template.cs
@@ -5,6 +5,7 @@
using Nox.Abstractions;
using Nox.Types;
using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
namespace {{codeGeneratorState.ApplicationNameSpace }}.Dto;
@@ -18,6 +19,9 @@ public partial class {{className}}
///
/// {{attribute.Description}} ({{if attribute.IsRequired}}Required{{else}}Optional{{end}}).
///
+ {{- if attribute.IsRequired}}
+ [Required(ErrorMessage = "{{attribute.Name}} is required")]
+ {{ end}}
{{ if componentsInfo[attribute.Name].IsSimpleType -}}
public {{componentsInfo[attribute.Name].ComponentType}}{{ if !attribute.IsRequired}}?{{end}} {{attribute.Name}} { get; set; } {{if attribute.IsRequired}}= default!;{{end}}
{{- else -}}
diff --git a/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Dto.AllNoxTypeUpdateDto.g.cs b/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Dto.AllNoxTypeUpdateDto.g.cs
index 5439adeaff..107fc37ef9 100644
--- a/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Dto.AllNoxTypeUpdateDto.g.cs
+++ b/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Dto.AllNoxTypeUpdateDto.g.cs
@@ -5,6 +5,7 @@
using Nox.Abstractions;
using Nox.Types;
using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
namespace SampleWebApp.Application.Dto;
@@ -25,10 +26,14 @@ public partial class AllNoxTypeUpdateDto
///
/// CountryCode2 Nox Type (Required).
///
+ [Required(ErrorMessage = "CountryCode2Field is required")]
+
public System.String CountryCode2Field { get; set; } = default!;
///
/// CountryCode3 Nox Type (Required).
///
+ [Required(ErrorMessage = "CountryCode3Field is required")]
+
public System.String CountryCode3Field { get; set; } = default!;
///
/// CountryNumber Nox Type (Optional).
@@ -81,6 +86,8 @@ public partial class AllNoxTypeUpdateDto
///
/// Text Nox Type (Required).
///
+ [Required(ErrorMessage = "TextField is required")]
+
public System.String TextField { get; set; } = default!;
///
/// StreetAddress Nox Type (Optional).
diff --git a/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Dto.CountryLocalNamesUpdateDto.g.cs b/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Dto.CountryLocalNamesUpdateDto.g.cs
index 1699ba1431..f86f249e74 100644
--- a/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Dto.CountryLocalNamesUpdateDto.g.cs
+++ b/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Dto.CountryLocalNamesUpdateDto.g.cs
@@ -5,6 +5,7 @@
using Nox.Abstractions;
using Nox.Types;
using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
namespace SampleWebApp.Application.Dto;
diff --git a/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Dto.CountryUpdateDto.g.cs b/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Dto.CountryUpdateDto.g.cs
index e00179d01b..c8f01d61d5 100644
--- a/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Dto.CountryUpdateDto.g.cs
+++ b/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Dto.CountryUpdateDto.g.cs
@@ -5,6 +5,7 @@
using Nox.Abstractions;
using Nox.Types;
using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
namespace SampleWebApp.Application.Dto;
@@ -17,22 +18,32 @@ public partial class CountryUpdateDto
///
/// The country's common name (Required).
///
+ [Required(ErrorMessage = "Name is required")]
+
public System.String Name { get; set; } = default!;
///
/// The country's official name (Required).
///
+ [Required(ErrorMessage = "FormalName is required")]
+
public System.String FormalName { get; set; } = default!;
///
/// The country's official ISO 4217 alpha-3 code (Required).
///
+ [Required(ErrorMessage = "AlphaCode3 is required")]
+
public System.String AlphaCode3 { get; set; } = default!;
///
/// The country's official ISO 4217 alpha-2 code (Required).
///
+ [Required(ErrorMessage = "AlphaCode2 is required")]
+
public System.String AlphaCode2 { get; set; } = default!;
///
/// The country's official ISO 4217 alpha-3 code (Required).
///
+ [Required(ErrorMessage = "NumericCode is required")]
+
public System.Int16 NumericCode { get; set; } = default!;
///
/// The country's phone dialing codes (comma-delimited) (Optional).
@@ -49,6 +60,8 @@ public partial class CountryUpdateDto
///
/// Country area in square kilometers (Required).
///
+ [Required(ErrorMessage = "AreaInSquareKilometres is required")]
+
public System.Decimal AreaInSquareKilometres { get; set; } = default!;
///
/// The the position of the workplace's point on the surface of the Earth (Optional).
@@ -57,14 +70,20 @@ public partial class CountryUpdateDto
///
/// The region the country is in (Required).
///
+ [Required(ErrorMessage = "GeoRegion is required")]
+
public System.String GeoRegion { get; set; } = default!;
///
/// The sub-region the country is in (Required).
///
+ [Required(ErrorMessage = "GeoSubRegion is required")]
+
public System.String GeoSubRegion { get; set; } = default!;
///
/// The world region the country is in (Required).
///
+ [Required(ErrorMessage = "GeoWorldRegion is required")]
+
public System.String GeoWorldRegion { get; set; } = default!;
///
/// The estimated population of the country (Optional).
diff --git a/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Dto.CurrencyUpdateDto.g.cs b/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Dto.CurrencyUpdateDto.g.cs
index 4a7b24bb08..592ec22bcc 100644
--- a/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Dto.CurrencyUpdateDto.g.cs
+++ b/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Dto.CurrencyUpdateDto.g.cs
@@ -5,6 +5,7 @@
using Nox.Abstractions;
using Nox.Types;
using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
namespace SampleWebApp.Application.Dto;
@@ -17,5 +18,7 @@ public partial class CurrencyUpdateDto
///
/// The currency's name (Required).
///
+ [Required(ErrorMessage = "Name is required")]
+
public System.String Name { get; set; } = default!;
}
\ No newline at end of file
diff --git a/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Dto.StoreSecurityPasswordsUpdateDto.g.cs b/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Dto.StoreSecurityPasswordsUpdateDto.g.cs
index 6aa2b0e1a2..fa3d51d900 100644
--- a/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Dto.StoreSecurityPasswordsUpdateDto.g.cs
+++ b/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Dto.StoreSecurityPasswordsUpdateDto.g.cs
@@ -5,6 +5,7 @@
using Nox.Abstractions;
using Nox.Types;
using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
namespace SampleWebApp.Application.Dto;
@@ -17,9 +18,13 @@ public partial class StoreSecurityPasswordsUpdateDto
///
/// (Required).
///
+ [Required(ErrorMessage = "Name is required")]
+
public System.String Name { get; set; } = default!;
///
/// (Required).
///
+ [Required(ErrorMessage = "SecurityCamerasPassword is required")]
+
public System.String SecurityCamerasPassword { get; set; } = default!;
}
\ No newline at end of file
diff --git a/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Dto.StoreUpdateDto.g.cs b/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Dto.StoreUpdateDto.g.cs
index 31db01a5c6..eeb96e0c94 100644
--- a/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Dto.StoreUpdateDto.g.cs
+++ b/src/SampleWebApp/Generated/Nox.Generator/Nox.Generator.NoxCodeGenerator/Dto.StoreUpdateDto.g.cs
@@ -5,6 +5,7 @@
using Nox.Abstractions;
using Nox.Types;
using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
namespace SampleWebApp.Application.Dto;
@@ -17,9 +18,13 @@ public partial class StoreUpdateDto
///
/// Store Name (Required).
///
+ [Required(ErrorMessage = "Name is required")]
+
public System.String Name { get; set; } = default!;
///
/// Physical Money in the Physical Store (Required).
///
+ [Required(ErrorMessage = "PhysicalMoney is required")]
+
public MoneyDto PhysicalMoney { get; set; } = default!;
}
\ No newline at end of file