First Name must be less than 250 Character C# but i have checked my backend no such thing [closed]

First Name must be less than 250 Character C# but i have checked my backend no such thing [closed]
typescript
Ethan Jackson

I don't know what I am doing wrong here

First Name must be less than 250 Character C# but i have checked my backend no such thingenter image description here

public class CreateMemberView { [Required(ErrorMessage = "FullName is Required")] public string FullName { get; set; } [Required(ErrorMessage = "Gender is Required")] public Gender? Gender { get; set; } [Required(ErrorMessage = "Country is Required")] public int? CountryId { get; set; } [Required(ErrorMessage = "Display Name is Required")] public string DisplayName { get; set; } public string ProfilePicUrl { get; set; } public IFormFile? FileUpload { get; set; } public byte[] ProfilePic { get; set; } [MinAge(18, "You must be 18 year old to use this platform")] [Required(ErrorMessage = "Date Of Birth is Required")] public DateTime? DateOfBirth { get; set; } }

Answer

Check for the following:

Search Your Codebase

Use your IDE’s "Find in Files" feature to search for:MaxLength(250) StringLength(250)

"First Name must be less than 250 characters"

If your frontend (e.g., Angular, React) has validation rules, it could send invalid data to the API. Check client-side validation logic.

Locating EF Fluent API Configuration If you’re using Entity Framework’s Fluent API, check your DbContext class:

protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity<User>() .Property(u => u.FirstName) .HasMaxLength(250); }

Related Articles