Hi,
I added a new data table called GoldRate (Id(int), YelloGoldRate(decimal), WhiteGoldRate(decimal)). And View Page is GoldRate. See Code below
public ActionResult GoldRate()
{
if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings))
return AccessDeniedView();
var model = _goldrateSettings.ToModel();
return View(model);
}
public static GoldRateSettingsModel ToModel(this GoldRateSettings entity)
{
return Mapper.Map<GoldRateSettings, GoldRateSettingsModel>(entity);
}
public class GoldRateSettings : ISettings
{
public int Id { get; set; }
public decimal? YelloGoldRate { get; set; }
public decimal? WhiteGoldRate { get; set; }
}
public class GoldRateSettingsModel
{
[NopResourceDisplayName("Admin.Configuration.Settings.GoldRate.ID")]
public int Id { get; set; }
[NopResourceDisplayName("Admin.Configuration.Settings.GoldRate.YelloGoldRate")]
public decimal? YelloGoldRate { get; set; }
[NopResourceDisplayName("Admin.Configuration.Settings.GoldRate.WhiteGoldRate")]
public decimal? WhiteGoldRate { get; set; }
}
i got error in return Mapper.Map<GoldRateSettings, GoldRateSettingsModel>(entity);
"Trying to map Nop.Core.Domain.Configuration.GoldRateSettings to Nop.Admin.Models.Settings.GoldRateSettingsModel.
Exception of type 'AutoMapper.AutoMapperMappingException' was thrown."
Help need.
Thanks