Add post, fix delete forum, fix null pointer exceptions, min max limist

on database strings
This commit is contained in:
2017-06-12 17:22:58 +03:00
parent 1249950059
commit 430d02f59e
10 changed files with 148 additions and 22 deletions

View File

@@ -21,6 +21,7 @@ namespace DAL.Helpers
};
ctx.Foorums.Add(foorum);
ctx.SaveChanges();
for (int i = 0; i < 3; i++)
@@ -30,7 +31,8 @@ namespace DAL.Helpers
Title = $"Post {i}",
Author = "Karu",
Body = $"Pikk sisu {i}",
CreationTime = DateTime.Now
CreationTime = DateTime.Now,
ForumId = foorum.FoorumId
};
ctx.Posts.Add(post);
foorum.Posts.Add(post);