public static AbstractEntities.NewPartner ToAbstract(this NewPartner web) { if (web == null) { return(null); } return(new AbstractEntities.NewPartner(web.Name, web.Address)); }
public IActionResult Create([FromBody] NewPartner newPartner) { if (newPartner == null) { throw new InvalidRequestArgumentException("The partner cannot be null or empty."); } if (string.IsNullOrWhiteSpace(newPartner.Name)) { throw new InvalidRequestArgumentException("Partner name cannot be null or empty."); } var createdPartner = dataLayer.CreatePartner(newPartner.ToAbstract()); return(CreatedAtAction("Get", new { id = createdPartner.Id }, createdPartner.ToWeb())); }
public NewPartnerDropIn(BaseForm baseForm, Partner partner, DropInClosed onDropInClosed) : base(baseForm, onDropInClosed) { InitializeComponent(); if (partner != null) { btnSave.Text = "Gem"; lblNewPartner.Text = "Redigér partner"; } newPartnerForm = new NewPartner(baseForm, partner); newPartnerForm.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top; newPartnerForm.Location = new Point(10, 10); pnlContentHolder.Controls.Add(newPartnerForm); }
public static Partner CreatePartner(this PartnersController controller, NewPartner newPartner) { var actionResult = (CreatedAtActionResult)controller.Create(newPartner); return((Partner)actionResult.Value); }
public async void PublishNewPartner(NewPartner newPartner) { await _bus.PublishAsync(newPartner); }