Created
May 20, 2015 22:32
-
-
Save codebeaulieu/bb4d90e9f47b1c1d9b6b to your computer and use it in GitHub Desktop.
Post.cs | Stack Overflow | How to resolve ModelState.IsValid = false while binding a List type?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Post : IEntity | |
{ | |
[Key] | |
public int Id { get; set; } | |
[Required] | |
public string Title { get; set; } | |
public string URL { get; set; } | |
[Required] | |
public string IntroText { get; set; } | |
[Required] | |
public string Body { get; set; } | |
[DatabaseGenerated(DatabaseGeneratedOption.Computed)] | |
[Column(TypeName = "DateTime")] | |
public DateTime Created { get; set; } | |
[DatabaseGenerated(DatabaseGeneratedOption.Computed)] | |
[Column(TypeName = "DateTime")] | |
public DateTime? Modified { get; set; } | |
[Required] | |
public string Author { get; set; } | |
public List<Comment> Comments { get; set; } | |
public List<Tag> Tags { get; set; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment