public async Task <IActionResult> Create(PartnerContactResource resource) { var response = new SingleModelResponse <PartnerContactResource>(); if (resource == null) { response.DidError = true; response.ErrorMessage = ResponseMessageConstants.NotFound; return(response.ToHttpResponse()); } try { var entity = new PartnerContact(); _mapper.Map(resource, entity); var entityAdded = await _repository.AddAsync(entity); response.Model = _mapper.Map(entityAdded, resource); response.Message = ResponseMessageConstants.Success; } catch (Exception ex) { response.DidError = true; response.ErrorMessage = ex.ToString(); _logger.LogError(ex.InnerException.ToString()); } return(response.ToHttpResponse()); }
public PartnerContact UpdatePartnercontact(PartnerContact Partnercontact) { return(partnerrepo.UpdatePartnercontact(Partnercontact)); }
public PartnerContact UpdatePartnercontact(PartnerContact Partnercontact) { _dbContext.PartnerContact.Add(Partnercontact); _dbContext.SaveChanges(); return(Partnercontact); }