public async Task <ActionResult <Recipient> > PostRecipient([FromBody] Recipient recipient) { _repository.Insert(recipient); await _repository.Save(); return(CreatedAtAction(nameof(Recipient), new { document = recipient.Document }, recipient)); }
public ActionResult Create([Bind(Include = "Id,MarketPlaceIdentifier,MarketPlaceAssignedPolicyNumber,PolicyIssuerName,RecipientFirstName,RecipientMiddleName,RecipientLastName,RecipientFirstSSN,RecipientDob,RecipientSpouseFirstName,RecipientSpouseMiddleName,RecipientSpouseLastName,RecipientSpouseSSN,RecipientSpouseDob,CreatedDate,CreatedBy,IsActiveRecord,DeactivatedDate,DeactivatedBy")] Recipient recipient) { if (ModelState.IsValid) { _recipientRepository.Add(recipient); _recipientRepository.Save(); return(RedirectToAction("Index")); } return(View(recipient)); }
public void CreateRecepient(IRecipient recipient) { DbAccess.Entities.Recipient dbrecipient = new DbAccess.Entities.Recipient() { RecipientId = recipient.RecipientId, CompanyName = recipient.CompanyName, Account = recipient.Account, Active = true, Address = recipient.Address, CustomerServiceUrl = recipient.CustomerServiceUrl }; repo.Insert(dbrecipient); repo.Save(); }