Add post, fix delete forum, fix null pointer exceptions, min max limist
on database strings
This commit is contained in:
@@ -8,10 +8,23 @@ namespace DAL.Domain
|
||||
{
|
||||
[Key]
|
||||
public int FoorumId { get; set; }
|
||||
|
||||
[MaxLength(length: 128)]
|
||||
[MinLength(length: 1)]
|
||||
public string Title { get; set; }
|
||||
|
||||
[MaxLength(length: 256)]
|
||||
[MinLength(length: 1)]
|
||||
public string Description { get; set; }
|
||||
|
||||
|
||||
[MaxLength(length: 1024)]
|
||||
[MinLength(length: 1)]
|
||||
public string Body { get; set; }
|
||||
public DateTime CreationTime { get; set; }
|
||||
|
||||
[MaxLength(length: 128)]
|
||||
[MinLength(length: 1)]
|
||||
public string Author { get; set; }
|
||||
|
||||
public bool Visible { get; set; } = true;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace DAL.Domain
|
||||
{
|
||||
@@ -7,13 +8,22 @@ namespace DAL.Domain
|
||||
{
|
||||
[Key]
|
||||
public int PostId { get; set; }
|
||||
|
||||
[MaxLength(length: 128)]
|
||||
[MinLength(length: 1)]
|
||||
public string Title { get; set; }
|
||||
|
||||
[MaxLength(length: 1024)]
|
||||
[MinLength(length: 1)]
|
||||
public string Body { get; set; }
|
||||
public DateTime CreationTime { get; set; }
|
||||
|
||||
[MaxLength(length: 128)]
|
||||
[MinLength(length: 1)]
|
||||
public string Author { get; set; }
|
||||
|
||||
|
||||
public int ForumId { get; set; }
|
||||
public Foorum Foorum { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user