Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am having problems with the method of the controller using Microsoft.AspNetCore.MVC using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace Dropbox2A.Controllers {

I am having problems with the method of the controller

using Microsoft.AspNetCore.MVC

using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks;

namespace Dropbox2A.Controllers { public class EmployeeController : Controller { //GET: // public IActionResult Index() { return View(); } public string PayAmount (string name, int rate, int hours) { PayAmount = (char)(rate * hours);

return $"{name}'s pay amount is {PayAmount}"; } } } image text in transcribed

Startup.cs

using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc;

namespace Dropbox2A { public class Startup { // This method gets called by the runtime. Use this method to add services to the container. // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) { services.AddMvc(); }

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); }

app.UseRouting();

app.UseEndpoints(endpoints => { endpoints.MapControllerRoute( name: "default", pattern: "{controller=Home}/{action=Index}/{id?}"); }); } } }

When the user enters the following URL

https://localhost:44335/Employee/PayAmount?name=Lynn&rate=25&hours=12

image text in transcribed

image text in transcribed

- 0 1 X Cartup.cs Dropbox2A EmployeeController.cs* + x Dropbox2A: Overview Dropbox2A.Controllers. EmployeeController Solution Explorer www.www.www. PayAmount(string name, int rate, int hours) 8 { 9 10 11 12 13 O references public class EmployeeController : Controller { //GET: / EmployeeController > T appsettings.json > C# Program.cs c# Startup.cs 14 15 16 17 18 19 20 return $"{name}'s pay amount is {PayAmount}"; } 21 22 23 24 } Properties IX CEIP d. DELIVERY Programming Challenge 2.2 Continue to work on Programming Challenge 2.1. When the user enters localhost/Employee/Pay Amount?name=Lynn&rate=25&hours=12 The browser should show "Lynn's pay amount is $300.00." as shown in amount depends on the rate and hours values in the URL. http:/localhost 57276/Employee/PayAmount?name=Lynn&rate=3 Lynn's pay amount is $300.00. Figure 2.20 Programming Challenge 2.2 Browser Output. 42 following Memming Challenge 2.1. When the user enters the Portmountimame=Lynn&rate=25&hours=12 show Inns pay amount is $300.00." as shown in Figure L.A. Enter Sub an die nae and hours values in the URL. ter the s kozares1276/Employe/PayAmount?name=Lynn&rate=25&hours=12 mount is $300.00. Ent En ming Challenge 2.2 Browser Output

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Antipatterns Avoiding The Pitfalls Of Database Programming

Authors: Bill Karwin

1st Edition

1680508989, 978-1680508987

More Books

Students also viewed these Databases questions

Question

Write a note on job design.

Answered: 1 week ago

Question

Compute the derivative of f(x)cos(-4/5x)

Answered: 1 week ago

Question

Discuss the process involved in selection.

Answered: 1 week ago

Question

Differentiate tan(7x+9x-2.5)

Answered: 1 week ago

Question

1. PricewaterhouseCoopers

Answered: 1 week ago

Question

3. SCC Soft Computer

Answered: 1 week ago