I work at Blazor (C #) Server- Side. I am trying to save data to a database when registering a user (when I press the register button), but the following error occurs:
System.NullRefe renceException: 'The object reference is not set on the object instance.' <> 4__this._dataCo ntext.
I read on the Internet about that mistake, but I couldn't figure out what the problem was with me.
Find the code snippets below:...
User Profile
Collapse
-
C#- Error in DbContext
-
kdaic1712 started a topic How do I add code that will show if a company exists? This should only be displayed as a message on the screen.in C SharpHow do I add code that will show if a company exists? This should only be displayed as a message on the screen.
...Code:User.cs: [Table("Users")] public class User { [Display(AutoGenerateField = false)] public int UserId { get; set; } [Display(Name = "UserName")] [Required(ErrorMessage = "UserName is required.")] public string UserName { get; set; } [Display(Name = "Password")]
No activity results to display
Show More