Код: Выделить всё
Dictionary dic = new Dictionary
{
...
{ PlanVariablesDefinitions.Growth_Proposed_Savings_Rate, L.GrowthProposedSavingsRate.ToString("0.00") },
{ PlanVariablesDefinitions.Growth_Proposed_Income_Growth_Rate, L.GrowthProposedIncomeGrowthRate.ToString() },
{ PlanVariablesDefinitions.Growth_Proposed_Portfolio_Growth_Rate, L.GrowthProposedPortfolioGrowthRate.ToString() },
{ PlanVariablesDefinitions.Growth_Proposed_FMVRealEstate_Growth_Rate, L.GrowthProposedFMVRealEstateGrowthRate.ToString() },
...
}
Код: Выделить всё
...
public const string Growth_Proposed_Savings_Rate = "Growth_Proposed_Savings_Rate";
public const string Growth_Proposed_Income_Growth_Rate = "Growth_Proposed_Income_Growth_Rate";
public const string Growth_Proposed_Portfolio_Growth_Rate = "Growth_Proposed_Portfolio_Growth_Rate";
public const string Growth_Proposed_FMVRealEstate_Growth_Rate = "Growth_Proposed_FMVRealEstate_Growth_Rate";
...
Пока я помещаю этот код только для сбоя. быстро и обнаруживать такие случаи при первом запуске:
Код: Выделить всё
foreach (var item in dic)
if (item.Key.Length > 50)
throw new Exception($"{item.Key} is over 50 chars and will throw an exception on DB save.");
Подробнее здесь: https://stackoverflow.com/questions/791 ... -db-column
Мобильная версия