public BonusEditModel GetForEdit(int?id) { if (id == null) { return(new BonusEditModel()); } var model = _bonusRepository.Get(id.Value).ProjectTo <BonusEditModel>(MapperConfig).FirstOrDefault(); return(model ?? new BonusEditModel()); }