locked
Validation Error When using Entity Framework RRS feed

  • Question

  • User2048898515 posted

    My aim is  doing partial update of entity, ie. Only one field named "Active", i am not intended to update other field. eg.Name field

    But name field is mandatory.

    I tried the .IsModified option, But the context throws Validation errors, saying that fields are required ie. Name field.

    Is there any other way to bypass this.

    Screenshot:

    https://imgur.com/a/QXEdynh

    Friday, November 9, 2018 1:45 PM

All replies

  • User475983607 posted

    nambir

    I tried the .IsModified option, But the context throws Validation errors, saying that fields are required ie. Name field.

    Is there any other way to bypass this.

    Screenshot:

    https://imgur.com/a/QXEdynh

    The error message indicates that you forgot to populate the required Name property of Educator type.  Keep in mind that can only see what you post.  Have you tried simply populating the Name property as the error suggests? 

    Friday, November 9, 2018 2:14 PM
  • User1520731567 posted

    Hi nambir,

    According to your error,Name cannot be empty.

    If you want to bypass this,I suggest you could delete the [Required] in model,

    [Required]
    public string Name { get; set; }

    Best Regards.

    Yuki Tao

    Monday, November 12, 2018 2:17 AM