Skip to content

Commit 35ce2ca

Browse files
authored
Merge pull request #8 from ahmedsza/7-support-250-characters-for-messages
Refactor message entity to include text length validation. resolves #7
2 parents f172d5b + 7f50528 commit 35ce2ca

File tree

1 file changed

+12
-4
lines changed
  • src/Application/src/RazorPagesTestSample/Data

1 file changed

+12
-4
lines changed
Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
1-
using System.ComponentModel.DataAnnotations;
2-
31
namespace RazorPagesTestSample.Data
42
{
53
#region snippet1
4+
/// <summary>
5+
/// Represents a message entity with a maximum length of 250 characters.
6+
/// </summary>
67
public class Message
78
{
9+
/// <summary>
10+
/// Gets or sets the unique identifier for the message.
11+
/// </summary>
812
public int Id { get; set; }
913

14+
/// <summary>
15+
/// Gets or sets the text of the message.
16+
/// The text is required and has a maximum length of 250 characters.
17+
/// </summary>
1018
[Required]
1119
[DataType(DataType.Text)]
12-
[StringLength(200, ErrorMessage = "There's a 200 character limit on messages. Please shorten your message.")]
20+
[StringLength(250, ErrorMessage = "There's a 250 character limit on messages. Please shorten your message.")]
1321
public string Text { get; set; }
1422
}
1523
#endregion
16-
}
24+
}

0 commit comments

Comments
 (0)