Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
71 views

I'm using data annotations from System.ComponentModel.DataAnnotations in my ASP.NET project. I get an error message where you can describe the requirements such as "Name is required" and etc....
DELI's user avatar
  • 11
1 vote
1 answer
66 views

I would like to define a class for different strings which Entity Framework Core will recognise and apply certain rules without data annotations. For instance I would like to replace the following ...
Corey Jensen's user avatar
2 votes
0 answers
97 views

I'm working on an ASP.NET Core Minimal API. We are using the MiniValidation library for request validation on our endpoints. We have some strict linting that means for reference types we need to ...
rcarrington's user avatar
  • 1,722
0 votes
1 answer
68 views

Here's my custom validator: public class CustomRuleFileTypeAttribute : ValidationAttribute { protected override ValidationResult IsValid(object value,ValidationContext validationContext) ...
bbWebDev's user avatar
0 votes
1 answer
54 views

I'm trying to get data annotations validation messages in Portuguese (pt-BR) but they remain in English even after setting the culture. Here's what I've tried - in Program.cs: var builder = ...
Max Bündchen's user avatar
0 votes
1 answer
58 views

Here's a model class (generated by scaffolding, nothing changed): using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; namespace ...
J. Barrett's user avatar
1 vote
1 answer
126 views

I have a simple model called FooModel that has a single string property called Text. I am attempting to use DataAnnotationsValidator to validate a collection of Models that are dynamically added to ...
Gabe's user avatar
  • 50.6k
0 votes
1 answer
81 views

I have a dataset annotated by three people, so now I have three files. This dataset is about tweets annotation. How can I combine this dataset into one file for further processing. The data set is an ...
ZAIN UL ABIDIN QADRI's user avatar
0 votes
1 answer
275 views

I have a model class in .NET 6.0 and applied data annotations. I have extension class ApiRequestValidation that returns validationresults after checking the JSON in the request body. using System....
PavanKumar GVVS's user avatar
0 votes
0 answers
86 views

I have a class Detail with a parameter of type List<string> public class Detail { public int index { get; set; } [MaxLength(50)] [RegularExpressionList("^[a-zA-Z0-9א-ת@/\\.\\- !@...
Nir Amir's user avatar
0 votes
2 answers
839 views

I'm trying to get automatic data validation working in an ApiController but when the user sends incorrect/missing data a JSON deserialization failed error message is returned instead of the custom ...
iKingNinja's user avatar
0 votes
1 answer
40 views

I have 4 checkboxes in my form and want user to select at least one of the checkbox when form is submitted. I am using ExpressiveAnnotations.Attributes; reference as we use this in other part of ...
Jay's user avatar
  • 1,039
0 votes
2 answers
41 views

I have a property with StringLength attribute, but I can assign a string of any length to this property. I created the following test program in VB.NET 4.7 Framework: Imports System.ComponentModel....
Alex's user avatar
  • 561
0 votes
1 answer
589 views

I have an appsettings.json with the following contents: { "Settings": { "Greeting": "Hello World" } } that I associate with public sealed class ...
user23207089's user avatar
1 vote
2 answers
988 views

In the handleSubmit-function of a Blazor CRUD component, I have to provide an error message that is based on the DataAnnotation MaxLength-attribute. I would like to show a "custom" C# error ...
John D's user avatar
  • 691
0 votes
1 answer
168 views

I have situation when I have 2 pods that getting requests to update status of object lets call him user, he have 3 statuses : new, verified and failed. they getting in parallel the entity with status ...
Napa's user avatar
  • 1
0 votes
1 answer
141 views

I have a huge number of images that have human. after a ran Yolov8 on them, all resulted labels are class 0 "person" I want to change to 3 classes class 0 "man", class 1 "...
Nada 's user avatar
0 votes
1 answer
49 views

I have a IdSeqAttribute: [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] public class IdSeq(string seq) : Attribute { public string Seq = seq; } and use it like ...
Rodolfo's user avatar
  • 71
-2 votes
2 answers
96 views

I need a regular expression for a URL-friendly slug, which can only contain lowercase letters and hyphens. It can't start or end with a hyphen and can't have more than one consecutive dash. It will be ...
Kenneth R. Jones's user avatar
0 votes
1 answer
109 views

What's changed? I've had this C# Razor app (SQL backend) developed and deployed in production for 3 years now. Recently, I've added 3 new tables in SQL and rather than use Package Manager console to ...
GCDevOps's user avatar
0 votes
0 answers
84 views

I set attribute to benefitID to [Column(TypeName="varchar(10)")] but when I run it benefit is nvarchar(450). [Key] [Column(TypeName="varchar(10)")] [StringLength(20)] [Required] ...
Chiến Trần's user avatar
0 votes
0 answers
33 views

I just wanted to be able for a user to select from a dropdown if their id number was a ssn or ein. I created a Farm entity and I wanted the user to select from a dropdown using Datalist whether or not ...
Christopher Blick's user avatar
3 votes
0 answers
887 views

What exactly is the difference between these two .NET attributes: [PasswordPropertyText] => PasswordPropertyTextAttribute [DataType(DataType.Password)] => DataTypeAttribute with a DataType ...
Alexandra Valkova's user avatar
0 votes
0 answers
21 views

I have a list of objects for my ASP.NET MVC model List<NameAddressModel>. In this abbreviated example, we're only looking at the first name. The model has the [Required] attribute, which will ...
NovaDev's user avatar
  • 2,971
0 votes
1 answer
569 views

I am migrating a project from ASP.NET MVC to ASP.NET Core 6.0. I have the following class in the ASP.NET MVC project: public class CustomModelMetadataProvider : DataAnnotationsModelMetadataProvider { ...
csharpdev's user avatar

1
2 3 4 5
61