Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/
Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index
The exact solution to your question may have been answered before, please use the search on the homepage.
-
ABP Framework version: v2.9.0
-
UI type: Angular / MVC
-
Tiered (MVC) or Identity Server Seperated (Angular): yes
-
Exception message and stack trace:
-
Steps to reproduce the issue:
in abp suite 2.9.0 - create a new entity with non-required properties (string type usually in my case)
migrate and update
form doesn't validate when non-required field is skipped
see below. In my Vendor Entity the Phone property is tagged as non-required:
server requires validation :
Even though the create DTO seems correct :
using System;
using System.ComponentModel.DataAnnotations;
namespace Skipj.Track.Vendors
{
public class VendorCreateDto
{
[Required]
[StringLength(VendorConsts.NameMaxLength, MinimumLength = VendorConsts.NameMinLength)]
public string Name { get; set; }
[StringLength(VendorConsts.PhoneMaxLength, MinimumLength = VendorConsts.PhoneMinLength)]
public string Phone { get; set; }
[EmailAddress]
[StringLength(VendorConsts.EmailMaxLength, MinimumLength = VendorConsts.EmailMinLength)]
public string Email { get; set; }
[StringLength(VendorConsts.WebsiteMaxLength, MinimumLength = VendorConsts.WebsiteMinLength)]
public string Website { get; set; }
[StringLength(VendorConsts.TaxIdMaxLength, MinimumLength = VendorConsts.TaxIdMinLength)]
public string TaxId { get; set; }
[StringLength(VendorConsts.VendorIdMaxLength, MinimumLength = VendorConsts.VendorIdMinLength)]
public string VendorId { get; set; }
[StringLength(VendorConsts.AltNameMaxLength, MinimumLength = VendorConsts.AltNameMinLength)]
public string AltName { get; set; }
[StringLength(VendorConsts.DbaNameMaxLength, MinimumLength = VendorConsts.DbaNameMinLength)]
public string DbaName { get; set; }
[StringLength(VendorConsts.NotesMaxLength, MinimumLength = VendorConsts.NotesMinLength)]
public string Notes { get; set; }
[Required]
public bool IsPrime { get; set; }
[Required]
public bool IsMdBased { get; set; }
public bool IsWomanOwned { get; set; }
[StringLength(VendorConsts.RatingMaxLength, MinimumLength = VendorConsts.RatingMinLength)]
public string Rating { get; set; }
[StringLength(VendorConsts.DisplayNameMaxLength, MinimumLength = VendorConsts.DisplayNameMinLength)]
public string DisplayName { get; set; }
public bool HasMdEmployees { get; set; }
[StringLength(VendorConsts.DunsNumberMaxLength, MinimumLength = VendorConsts.DunsNumberMinLength)]
public string DunsNumber { get; set; }
}
}
the angular input form doesn't mark anything as required either :
**SECOND question while I'm at it : why aren't required fields tagged as such on the angular form (like red dot or asterisk on the MV forms)
**