3
When executing the command Update-Database
Package Manager Console gets the following error:
Value cannot be null. Parameter name: entitySet
I have only one model in the project for now
public class Project
{
[Key]
public Guid ProjectId { get; set; }
public String Title { get; set; }
public String Content { get; set; }
public HttpPostedFileBase Image { get; set; }
public String Author { get; set; }
public String FileWay { get; set; }
[Required]
public DateTime DateProject { get; set; }
public DateTime? DateUpdate { get; set; }
public DateTime DateAudience { get; set; }
}
And my class DBContext
:
public class DialogoContext : IdentityDbContext<UserClient,Group , Guid, UserLogin, UserGroup, UserIdentity>
{
public DialogoContext()
: base("DialogoContext")
{
}
public static DialogoContext Create()
{
return new DialogoContext();
}
public DbSet<Project> Projects { get; set; }
}
I didn’t identify why that mistake.
What causes this mistake? How can I fix it ?
A lot of things can cause this mistake. Post the models.
– Jéf Bueno
@LINQ For now I have only this model that I inserted in the question edition!
– Renan Carlos
Take a test there, change the name of your class to
ProjectTeste
– Jéf Bueno
@LINQ same error! ;(
– Renan Carlos
Ah, young man. It’s because you have a property like
HttpPostedFileBase
...– Jéf Bueno