Skip to content

Commit 5234369

Browse files
committed
Added missing file
1 parent 044049e commit 5234369

File tree

4 files changed

+147
-0
lines changed

4 files changed

+147
-0
lines changed

Data/EmployeeDetails.cs

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
using System.ComponentModel.DataAnnotations;
5+
using System.Runtime.CompilerServices;
6+
7+
namespace EditFormValidation.Data
8+
{
9+
/// <summary>
10+
/// Get the employee details
11+
/// </summary>
12+
public class EmployeeDetails
13+
{
14+
[Required]
15+
public string FirstName { get; set; }
16+
public string LastName { get; set; }
17+
[Required]
18+
[DataType(DataType.EmailAddress)]
19+
[EmailAddress]
20+
public string Email { get; set; }
21+
public string Gender { get; set; } = "male";
22+
[Required]
23+
[DataType(DataType.PhoneNumber)]
24+
[Phone]
25+
public string PhoneNumber { get; set; }
26+
[Required]
27+
public DateTime? DOB { get; set; }
28+
[Required]
29+
public string Country { get; set; }
30+
[Required]
31+
public string City { get; set; }
32+
[Required]
33+
public string Address { get; set; }
34+
[Required]
35+
[Range(0, 20, ErrorMessage = "The Experience range should be 0 to 20")]
36+
public decimal? TotalExperience { get; set; }
37+
}
38+
39+
public class Countries
40+
{
41+
public string Name { get; set; }
42+
public string Code { get; set; }
43+
44+
public List<Countries> GetCountries()
45+
{
46+
List<Countries> Country = new List<Countries>
47+
{
48+
new Countries() { Name = "Australia", Code = "AU" },
49+
new Countries() { Name = "United Kingdom", Code = "UK" },
50+
new Countries() { Name = "United States", Code = "US" },
51+
};
52+
return Country;
53+
}
54+
}
55+
public class Cities
56+
{
57+
public string Name { get; set; }
58+
public string Code { get; set; }
59+
public string CountryCode { get; set; }
60+
public List<Cities> GetCities()
61+
{
62+
List<Cities> CityName = new List<Cities>
63+
{
64+
new Cities() { Name = "New York", CountryCode = "US", Code="US-101" },
65+
new Cities() { Name = "Virginia", CountryCode = "US", Code="US-102" },
66+
new Cities() { Name = "Washington", CountryCode = "US", Code="US-103" },
67+
new Cities() { Name = "Victoria", CountryCode = "AU", Code="AU-101" },
68+
new Cities() { Name = "Tasmania", CountryCode = "AU", Code="AU-102" },
69+
new Cities() { Name = "Queensland", CountryCode = "AU", Code="AU-103" },
70+
new Cities() { Name = "London", CountryCode = "UK", Code="UK-101" },
71+
new Cities() { Name = "Manchester", CountryCode = "UK", Code="UK-102" },
72+
new Cities() { Name = "Ashford", CountryCode = "UK", Code="UK-103" }
73+
};
74+
return CityName;
75+
}
76+
}
77+
}

Data/WeatherForecast.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
namespace EditFormValidation.Data
2+
{
3+
public class WeatherForecast
4+
{
5+
public DateOnly Date { get; set; }
6+
7+
public int TemperatureC { get; set; }
8+
9+
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
10+
11+
public string? Summary { get; set; }
12+
}
13+
}

Data/WeatherForecastService.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
namespace EditFormValidation.Data
2+
{
3+
public class WeatherForecastService
4+
{
5+
private static readonly string[] Summaries = new[]
6+
{
7+
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
8+
};
9+
10+
public Task<WeatherForecast[]> GetForecastAsync(DateOnly startDate)
11+
{
12+
return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast
13+
{
14+
Date = startDate.AddDays(index),
15+
TemperatureC = Random.Shared.Next(-20, 55),
16+
Summary = Summaries[Random.Shared.Next(Summaries.Length)]
17+
}).ToArray());
18+
}
19+
}
20+
}

Properties/launchSettings.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"iisSettings": {
3+
"windowsAuthentication": false,
4+
"anonymousAuthentication": true,
5+
"iisExpress": {
6+
"applicationUrl": "http://localhost:23117",
7+
"sslPort": 44381
8+
}
9+
},
10+
"profiles": {
11+
"http": {
12+
"commandName": "Project",
13+
"dotnetRunMessages": true,
14+
"launchBrowser": true,
15+
"applicationUrl": "http://localhost:5081",
16+
"environmentVariables": {
17+
"ASPNETCORE_ENVIRONMENT": "Development"
18+
}
19+
},
20+
"https": {
21+
"commandName": "Project",
22+
"dotnetRunMessages": true,
23+
"launchBrowser": true,
24+
"applicationUrl": "https://localhost:7168;http://localhost:5081",
25+
"environmentVariables": {
26+
"ASPNETCORE_ENVIRONMENT": "Development"
27+
}
28+
},
29+
"IIS Express": {
30+
"commandName": "IISExpress",
31+
"launchBrowser": true,
32+
"environmentVariables": {
33+
"ASPNETCORE_ENVIRONMENT": "Development"
34+
}
35+
}
36+
}
37+
}

0 commit comments

Comments
 (0)