Security Trimmed Menu as Partial View

I’m rendering a menu in my _Layout.cshtml file. One section of the menu should only render if the user is in the admin role. We are using custom roles in our DB. The Admin field comes back as a single character, “Y” or “N”. This was originally a legacy application and it’s being migrated to MVC 5. LINQ or Entity Framework is not being used.

SQL – Injection on Purpose in ASP.NET Core 2.1.7

I’m a college student and I’m in a class about computer security. I have a final project that I had to come up with so I decided to do a project where I create my own website and run a DoS attack and SQL Injection (I will also be doing a buffer overflow attack on my own VM). So I am creating a website using ASP.NET using Visual Studio 2019. I have not really worked with ASP.NET and I’m just trying to make a basic website. So far I have a webpage where you can view “Customers” and you can search for one. So I am creating this code so that I can SQL Inject and I understand the correct way to implement this. Here is my code so far