ITimeU.Models.AthleteClassModel.GetById C# (CSharp) Method

GetById() public static method

public static GetById ( int id ) : AthleteClassModel
id int
return AthleteClassModel
        public static AthleteClassModel GetById(int id)
        {
            using (var context = new Entities())
            {
                var model = context.AthleteClasses.Where(athleteclass => athleteclass.ID == id).Single();
                return new AthleteClassModel()
                {
                    Id = model.ID,
                    Name = model.Name
                };
            }
        }