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

GetOrCreate() public static method

public static GetOrCreate ( string name ) : AthleteClassModel
name string
return AthleteClassModel
        public static AthleteClassModel GetOrCreate(string name)
        {
            AthleteClass athleteClassDb = null;

            try
            {
                athleteClassDb = getDbEntry(name);
            }
            catch (InvalidOperationException)
            {
                athleteClassDb = createDbEntry(name);
            }

            return new AthleteClassModel(athleteClassDb);
        }