|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
namespace ModelBinding1.Models
{
//[MetadataType (typeof(EmployeeMetadata)) ]
public class Employee
{
[DisplayName("Employee ID")]
[Required(ErrorMessage = "ID Required")]
public int EmpId { get; set; }
[DisplayName("Employee Name")]
[Required]
public string EmpName { get; set; }
[DisplayName("Designation")]
[Required]
public string EmpDesignation { get; set; }
[DisplayName("Department")]
[Required]
public string EmpDepartment { get; set; }
[DisplayName("Salary")]
[Required]
public float EmpSalary { get; set; }
}
public class EmployeeSkills
{
[DisplayName("Employee ID")]
[Required(ErrorMessage = "ID Required")]
public int EmpId { get; set; }
[DisplayName("Employee Skills")]
public string[] Skills { get; set; }
}
public class EmployeeMetadata
{
[DisplayName("Employee ID")]
[Required(ErrorMessage="ID Required")]
public int EmpId { get; set; }
[DisplayName("Employee Name")]
[Required]
public string EmpName { get; set; }
[DisplayName("Designation")]
[Required]
public string EmpDesignation { get; set; }
[DisplayName("Department")]
[Required]
public string EmpDepartment { get; set; }
[DisplayName("Salary")]
[Required]
public float EmpSalary { get; set; }
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I have around 9 years of experience in Microsoft technologies, .Net 2.0,3.5, Asp.net MVC developed small to medium scale products using Silverlight 2.0, Asp.net Ajax technologie and Javascript frameworks.