Add project files.
This commit is contained in:
18
DiaryApp/Models/DiaryEntry.cs
Normal file
18
DiaryApp/Models/DiaryEntry.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DiaryApp.Models
|
||||
{
|
||||
public class DiaryEntry
|
||||
{
|
||||
//[Key]
|
||||
public int Id { get; set; }
|
||||
[Required(ErrorMessage = "Please enter a title")]
|
||||
[StringLength(50, MinimumLength = 3,
|
||||
ErrorMessage = "Title must be between 3 and 100 Characters!")]
|
||||
public string Title { get; set; } = string.Empty;
|
||||
[Required]
|
||||
public string Content { get; set; } = string.Empty;
|
||||
[Required]
|
||||
public DateTime DateCreated { get; set; } = DateTime.Now;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user