コード例 #1
0
        public async Task <ActionResult <Recipient> > PostRecipient([FromBody] Recipient recipient)
        {
            _repository.Insert(recipient);
            await _repository.Save();

            return(CreatedAtAction(nameof(Recipient), new { document = recipient.Document }, recipient));
        }
コード例 #2
0
 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();
 }