Files
Backend-Api/ServiceHost/Pages/contact-us/Index.cshtml.cs
2025-04-23 23:22:26 +03:30

31 lines
801 B
C#

using CompanyManagment.App.Contracts.ContactUs;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace ServiceHost.Pages.contact_us
{
public class IndexModel : PageModel
{
private readonly IContactUsApplication _contactUsApplication;
public IndexModel(IContactUsApplication contactUsApplication)
{
_contactUsApplication = contactUsApplication;
}
public void OnGet()
{
}
public IActionResult OnPostCreateAjax(CreateContactUs command)
{
var operationResult = _contactUsApplication.Create(command);
return new JsonResult(new
{
success = operationResult.IsSuccedded,
message = operationResult.Message
});
}
}
}