CustomerHistory objCustomerHistory = new CustomerHistory();
objCustomerHistory.StatusId = customerHistoryModel.StatusId;
objCustomerHistory.ActionId = customerHistoryModel.ActionId;
objCustomerHistory.IsCurrent = customerHistoryModel.IsCurrent;
//And
CustomerHistory objCustomerHistory = new CustomerHistory
{
StatusId = customerHistoryModel.StatusId,
ActionId = customerHistoryModel.ActionId,
IsCurrent = customerHistoryModel.IsCurrent,
HistoryData = JsonConvert.SerializeObject(objCustomerModel),
CreatedBy = customerHistoryModel.LoginUserId,
CreatedDate = DateTime.Now
};
What is the difference between this initialization.when i put the first initialization it give an error.how to fix it.