-
-
Save ShariqT/be03c2b53878e59ca7c60656ff70f991 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.AspNetCore.Mvc.RazorPages; | |
using Microsoft.Extensions.Logging; | |
using LobExampleApp; | |
namespace LobExampleApp.Pages | |
{ | |
public class NewAddressModel : PageModel | |
{ | |
private readonly ILogger<IndexModel> _logger; | |
public NewAddressModel(ILogger<IndexModel> logger) | |
{ | |
_logger = logger; | |
} | |
[BindProperty] | |
public LobAddressResult addressResult { get; set; } | |
public async Task<IActionResult> OnPost(LobAddressResult addressResult) | |
{ | |
if (!ModelState.IsValid) | |
{ | |
return Page(); | |
} | |
var api = new LobConnector(); | |
var resp = await api.saveAddress(addressResult); | |
return RedirectToPage("./Index"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment