This question's answers are a community effort. Edit existing
I activated the code generator tool, activated it, registered inside it and synchronized with it on several accounts, and when I formatted my phone, I lost access to my accounts on social media. Please help and solve my problem quickly.
See also questions close to this topic
-
How to get all model validation errors in ASP.NET api
My model looks like this:
public class Meeting : IValidatableObject { public string Id { get; set; } [Required] public string Start_time { get; set; } [Required] public string End_time { get; set; } [Required] public DateTime Date { get; set; } [Required] [Url] public string Url { get; set; } [Required] [RegularExpression(@"^[(a-zA-Z)' '(a-zA-Z)]*$", ErrorMessage = "Characters are not allowed.")] public string Owner { get; set; } [Required] [RegularExpression(@"^[(a-zA-Z)' '(a-zA-Z)]*$", ErrorMessage = "Characters are not allowed.")] public string Participant { get; set; } public IEnumerable<ValidationResult> Validate(ValidationContext validationContext) { List<ValidationResult> results = new List<ValidationResult>(); DateTime dt, dt1; if(DateTime.TryParse(Start_time, out dt) == false) { results.Add(new ValidationResult("Start time wrong", new[] { "Start time" })); } if (DateTime.TryParse(End_time, out dt1) == false) { results.Add(new ValidationResult("End time wrong", new[] { "End time" })); } if (string.Compare(Start_time, End_time) == 1) { results.Add(new ValidationResult("Time Conflict", new[] { "Time" })); } return results; } }
And I don't know how to get all errors in JSON both from model itself and
IEnumerable<ValidationResult> Validate
methodMy POST method has this realization:
[HttpPost] public IActionResult Create([FromBody] Meeting meet) { if (ModelState.IsValid) { Guid obj = Guid.NewGuid(); meet.Id = obj.ToString(); _dataAccessProvider.AddMeetingRecord(meet); return Ok("Meeting was successfully added"); } return BadRequest(ModelState); }
I tried to use IEnumerable allErrors = ModelState.Values.SelectMany(v => v.Errors); and return allErrors in BadRequest but it didn't work
-
What should be my IIS server specification to host 2-3 ASP .NET Application and some window service?
I've a GoDaddy server which has following specifications:
- 2-core CPU
- 8GB RAM
- 3.1 GHz
- 1000 GB HDD
I've hosted my application on IIS server 10 which includes
- An ASP .NET Application
- An ASP .NET Core 3.1 Application
- 2 Window service
Having a daily traffic of about 20-25 users which do the work while the code mainly does too heavy work like syncing data from several 3rd party API's and also provides data to other web applications which has a traffic of 300-500 users daily.
Please suggest me new server configuration and from where should I purchase server except GoDaddy as the current server is processing the data too slow.
-
How to import the SSL certificate from .PFX file with no password in ASP.NET
I have a ".PFX" certificate with no password. How Can I access the .pfx file in asp.net C#? I need code to import a certificate from the ".PFX" file with no password.