From 7fd0ee8fd1976092f5e08ad167eee2292f0e3cd4 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Wed, 23 Apr 2025 23:00:40 +0800 Subject: [PATCH 1/2] Add DataTypeAttribute section to Module Entity Extensions document --- .../modularity/extending/module-entity-extensions.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/en/framework/architecture/modularity/extending/module-entity-extensions.md b/docs/en/framework/architecture/modularity/extending/module-entity-extensions.md index 8a5b50652e..83c3ea5956 100644 --- a/docs/en/framework/architecture/modularity/extending/module-entity-extensions.md +++ b/docs/en/framework/architecture/modularity/extending/module-entity-extensions.md @@ -151,6 +151,17 @@ property => > Tip: Use `DefaultValueFactory` option only if the default value may change over the time (like `DateTime.Now` in this example). If it is a constant value, then use the `DefaultValue` option. +### DataTypeAttribute + +`DataTypeAttribute` is used to specify the type of the property. It is used to determine how to render the property on the user interface: + +````csharp +property => +{ + property.Attributes.Add(new DataTypeAttribute(DataType.Date)); +} +``` + ### Validation Entity extension system allows you to define validation for extension properties in a few ways. From ab2d7a2cce4890c4f4dc414a1413ff335061361d Mon Sep 17 00:00:00 2001 From: Engincan VESKE Date: Thu, 24 Apr 2025 06:14:35 +0000 Subject: [PATCH 2/2] Update module-entity-extensions.md --- .../modularity/extending/module-entity-extensions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/framework/architecture/modularity/extending/module-entity-extensions.md b/docs/en/framework/architecture/modularity/extending/module-entity-extensions.md index 83c3ea5956..ac041895d7 100644 --- a/docs/en/framework/architecture/modularity/extending/module-entity-extensions.md +++ b/docs/en/framework/architecture/modularity/extending/module-entity-extensions.md @@ -155,7 +155,7 @@ property => `DataTypeAttribute` is used to specify the type of the property. It is used to determine how to render the property on the user interface: -````csharp +```csharp property => { property.Attributes.Add(new DataTypeAttribute(DataType.Date));