namespace InventoryManager.Models { public static class ModelHelper { public static string GetModelName(string modelName) { string retString; try { int lastIndex = modelName.LastIndexOf('.')+1; retString = modelName.Substring(lastIndex, modelName.Length - (lastIndex+1)); } catch { retString = modelName; } return retString; } } }