Skip to content

Instantly share code, notes, and snippets.

@ShariqT
Created November 2, 2021 21:42
Show Gist options
  • Save ShariqT/be03c2b53878e59ca7c60656ff70f991 to your computer and use it in GitHub Desktop.
Save ShariqT/be03c2b53878e59ca7c60656ff70f991 to your computer and use it in GitHub Desktop.
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