错误:不能为非空字段Post.title返回null。(D:\graphql\Graphql-social-media-project\api\node_modules\graphql\execution\execute.js:594:13) at executeField (D:\graphql\Graphql-social-media-project\api\node_modules\graphql\execution\execute.js:489:19) at executeFields (D:\graphql\Graphql-social-media-project\api\node_
我正在致力于一个系统,应该允许用户注册一个独特的用户名,或唯一的电子邮件。同时登记也是可能的。
我使用的是默认标识页,并做了一些修改,下面是一个注册代码示例:
public class InputModel
{
//[Required] //Validated in server side based on role
[EmailAddress]
[Display(Name = "Email")]
public string Email { get; set; }
//[Requi
在im登录时,我已经在会话变量中获取了用户名,在我登录后,我检查了会话对象(用户名)是否为空,以获取显示在我的page.if中的用户名,会话对象为空,我使页面重定向到登录页面。但是在某些情况下,如果我在登录后单击任何页面中的任何链接,它会将我重定向到登录页面,但我没有单击注销按钮。为什么它使会话为空。必须放置wat以在我访问的页面中执行会话变量,而不是单击logout it not be cleared / null- asp.net
即使具有所需注释的属性具有有效值,ModelState.IsValid也返回false。我记录了对象的字符串表示,它显示用户名和密码不是空的。
用户模型
public class User
{
public int Id { get; set; }
[Required]
public string Username { get; set; }
[Required]
[DataType(DataType.Password)]
public string Password { get; set; }
[DataType(DataType