public void AddEditLeadTypes(int id, string leadType) { var leadTypeData = _leadRepository.FindBy(x => x.Id == id).FirstOrDefault(); if (leadTypeData == null) { _leadRepository.Add(new LeadType() { Name = leadType, IsActive = true, CreatedAt = currentPstTime, }); } else { leadTypeData.Name = leadType; leadTypeData.ModifiedAt = currentPstTime; _leadRepository.Update(leadTypeData, leadTypeData.Id); } }