Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
0feeef6
Update README.md
ahmetulucay Jan 2, 2023
d4e1d76
Update README.md
ahmetulucay Jan 2, 2023
53af0b9
Update README.md
ahmetulucay Jan 2, 2023
712b714
Update README.md
ahmetulucay Jan 2, 2023
6133a07
Update README.md
ahmetulucay Jan 2, 2023
4568d7e
Merge pull request #1 from GitAhmet/StudentAppAzureADAutht
ahmetulucay Jan 2, 2023
e71559b
Add validation for students adress field
CriticalSolution Jan 4, 2023
e8d0c16
Merge pull request #2 from GitAhmet/StudentAppAzureADAutht
ahmetulucay Jan 4, 2023
cadad3b
Commits 06.jan.23
ahmetulucay Jan 6, 2023
60f45ff
Merge pull request #3 from GitAhmet/StudentAppAzureADAutht
ahmetulucay Jan 6, 2023
a70175e
Merge pull request #4 from ahmetulucay/develop
ahmetulucay Jan 10, 2023
8901b3b
Update validation
CriticalSolution Jan 10, 2023
ffc8235
validations update
ahmetulucay Jan 10, 2023
b5185b0
Merge pull request #5 from ahmetulucay/StudentAppAzureADAutht
ahmetulucay Jan 10, 2023
5c69002
commit message 12.jan.
ahmetulucay Jan 12, 2023
12e8718
Merge pull request #6 from ahmetulucay/StudentAppAzureADAutht
ahmetulucay Jan 12, 2023
e662eb9
AddressModel
ahmetulucay Jan 13, 2023
1fd01bb
Merge pull request #7 from ahmetulucay/StudentAppAzureADAutht
ahmetulucay Jan 13, 2023
3704608
Merge pull request #8 from ahmetulucay/develop
ahmetulucay Jan 21, 2023
5684b6f
Merge pull request #9 from ahmetulucay/StudentAppAzureADAutht
ahmetulucay Jan 21, 2023
559c33b
Merge pull request #10 from ahmetulucay/develop
ahmetulucay Jan 22, 2023
2de68a8
Merge pull request #11 from ahmetulucay/StudentAppAzureADAutht
ahmetulucay Jan 22, 2023
6a03a10
Merge pull request #12 from ahmetulucay/develop
ahmetulucay Jan 24, 2023
b6edc7d
Merge pull request #13 from ahmetulucay/StudentAppAzureADAutht
ahmetulucay Jan 24, 2023
ee03452
commit message
ahmetulucay Jan 25, 2023
a864d4a
Merge pull request #14 from ahmetulucay/StudentAppAzureADAutht
ahmetulucay Jan 25, 2023
4f4098d
Include UpdateStudentRequest
ahmetulucay Jan 25, 2023
cdcfdba
Update README.md
ahmetulucay Jan 25, 2023
841c30b
Update README.md
ahmetulucay Jan 25, 2023
ae9b9e0
Update README.md
ahmetulucay Jan 25, 2023
22a0dcf
Adding PhoneNo and EmailAddress
ahmetulucay Jan 25, 2023
9811e15
Merge pull request #15 from ahmetulucay/StudentAppAzureADAutht
ahmetulucay Jan 25, 2023
aa5307f
ICollection
ahmetulucay Jan 28, 2023
86e4dab
Merge pull request #16 from ahmetulucay/StudentAppAzureADAutht
ahmetulucay Jan 28, 2023
0c4a10d
ICollection, List
ahmetulucay Jan 30, 2023
b0d21d3
Merge pull request #17 from ahmetulucay/StudentAppAzureADAutht
ahmetulucay Jan 30, 2023
5c7587d
StudentAppModelsUpdate
ahmetulucay Feb 4, 2023
26d0431
Merge pull request #18 from ahmetulucay/StudentAppAzureADAutht
ahmetulucay Feb 4, 2023
79a044e
Index&Layout
ahmetulucay Mar 3, 2023
1529f9f
Merge pull request #19 from ahmetulucay/develop
ahmetulucay Mar 3, 2023
bf0ecd0
Merge branch 'StudentAppAzureADAutht' of https://github.com/GitAhmet/…
ahmetulucay Mar 5, 2023
f62d2cb
BeforeAuthentication
ahmetulucay Mar 5, 2023
f064405
Update requests
CriticalSolution Mar 7, 2023
752292a
Update README.md
ahmetulucay Mar 7, 2023
5f77647
RecreatingContext
ahmetulucay Mar 9, 2023
5d8011b
RecreatingContext
ahmetulucay Mar 9, 2023
5a40ac6
UpdateModels&Repo
ahmetulucay Mar 10, 2023
e73c735
UpdateModels&Repo
ahmetulucay Mar 10, 2023
94dea56
Update Students.cs
ahmetulucay Mar 11, 2023
11fb9a8
Updates11Mars
ahmetulucay Mar 11, 2023
a6f0011
Merge branch 'BeforeAuthentication' of https://github.com/GitAhmet/St…
ahmetulucay Mar 11, 2023
6beb8c9
DeleteUpdate
ahmetulucay Mar 12, 2023
bd43779
StudentImageTable
ahmetulucay Mar 14, 2023
2841515
UploadImage
ahmetulucay Mar 17, 2023
0c40993
ModifiedFiles
ahmetulucay Mar 18, 2023
859ad34
StudentImage
ahmetulucay Mar 19, 2023
bd91305
Updates23.03.23
ahmetulucay Mar 23, 2023
d712ee0
Changed StudentRequest endpoint
CriticalSolution Mar 25, 2023
4a20209
ExportImage
ahmetulucay Mar 31, 2023
e0b05bb
UpdatesUploadImage
ahmetulucay Apr 2, 2023
e62154e
Upload&ExportImage
ahmetulucay Apr 4, 2023
493db74
Updates05.04.23
ahmetulucay Apr 5, 2023
8da2009
Swagger&AzureAdConfigs
ahmetulucay Apr 8, 2023
b336c8d
LastUpdates
ahmetulucay Apr 8, 2023
b7cad39
Update Program.cs
ahmetulucay Apr 8, 2023
87fdd4b
Update Students.cs
ahmetulucay Apr 8, 2023
6566dae
AppConfig
ahmetulucay Apr 9, 2023
b29b523
AppConfigUpdates
ahmetulucay Apr 9, 2023
b572b29
LastUpdates
ahmetulucay Apr 13, 2023
0a9a41f
Merge pull request #22 from ahmetulucay/ReadVariablesFromClass
ahmetulucay Apr 13, 2023
3113e1c
Configurations
ahmetulucay Apr 16, 2023
f54238e
AzureBlob
ahmetulucay Apr 26, 2023
fdb3dc8
Serilog
ahmetulucay Apr 27, 2023
6f3f69e
SeriLog2
ahmetulucay Apr 28, 2023
df0d51a
30.4.23
ahmetulucay Apr 29, 2023
154602e
SeriLog.WriteTo.Console
ahmetulucay Apr 30, 2023
642537b
WriteToName.Console
ahmetulucay May 2, 2023
8ec0b6f
logpath
ahmetulucay May 13, 2023
224ff9d
Protos
ahmetulucay May 18, 2023
e28112e
GrpcService
ahmetulucay May 21, 2023
4c2c2ae
MsgGrpServiceGetAllStudents
ahmetulucay May 28, 2023
c393f3b
Merge branch 'develop' into gRPC
ahmetulucay May 31, 2023
7ace10b
Merge pull request #23 from ahmetulucay/gRPC
ahmetulucay May 31, 2023
a294156
MsgGrpServiceGetStudent
ahmetulucay May 31, 2023
0eddb2a
Merge pull request #24 from ahmetulucay/develop
ahmetulucay May 31, 2023
c63ffe9
MessageGroupService.AddStudent
ahmetulucay Jun 5, 2023
bfb204c
Merge branch 'gRPC' of https://github.com/GitAhmet/StudentAppAzureADL…
ahmetulucay Jun 5, 2023
d285c48
UpdateStudentTables
ahmetulucay Jun 13, 2023
da10c0c
MessageGrpcService19.06.23
ahmetulucay Jun 18, 2023
eb3a0cc
MsgGrpService24.06.23
ahmetulucay Jun 24, 2023
6502dde
MessageGrpServiceUpdateForGetAllStudents&GetStudent
ahmetulucay Aug 13, 2023
371a43f
Update AddressStudentRequest.cs
ahmetulucay Mar 12, 2024
a382a0d
Update SwaggerAzureAD.cs
ahmetulucay Mar 30, 2024
48a753d
Update AzureAd.cs
ahmetulucay Mar 30, 2024
992b5bb
Update StorageService.cs
ahmetulucay Mar 30, 2024
dcced94
Update StudentAppContext.cs
ahmetulucay Mar 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
[*.cs]

# CS8618: Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
dotnet_diagnostic.CS8618.severity = none
csharp_using_directive_placement = outside_namespace:silent
csharp_prefer_simple_using_statement = true:suggestion
csharp_prefer_braces = true:silent
csharp_style_namespace_declarations = block_scoped:silent
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_accessors = true:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
csharp_indent_labels = one_less_than_current
csharp_space_around_binary_operators = before_and_after

[*.{cs,vb}]
#### Naming styles ####

# Naming rules

dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i

dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case

dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case

# Symbol specifications

dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.interface.required_modifiers =

dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.types.required_modifiers =

dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.non_field_members.required_modifiers =

# Naming styles

dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case

dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case

dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
indent_size = 4
end_of_line = crlf
47 changes: 31 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ ASP.NET Core 6/7 MVC & EF (Code-First) (HttpGet/Post/Put/Delete) Swagger Azure A
********************************************************
STEPS (Swagger Azure AD Autht - Swagger Azure AD Login)=
********************************************************
![Authorized Page](https://user-images.githubusercontent.com/57094137/210284591-4a4d7eaa-275f-49ea-bf0a-a87bdf80f35f.jpg)

Opening programs =
--------------------------------------
Open programs =
-----------------------------------
Open Visual Studio/-Code.
After that Open your project/api (Exp.=StudentApp)

Expand All @@ -16,6 +17,9 @@ Creating Swagger Azure AD Api =
Now we are in project/api in Visual Studio/-Code,

- On Connected services/Solution Explorer click right & add Microsoft Identity Platform,

![ConnectedServices-Microsoft Identity Platform](https://user-images.githubusercontent.com/57094137/210285547-d47ebdbb-f02a-488c-8fec-3328709199b9.jpg)

- On the new opened page if you are not login to Azure login/sign in to Azure,
- On the new opened page after logging in you will see your created App's name as a list,
- We are still on this page, on the upper right click (+) to create/register application,
Expand Down Expand Up @@ -51,17 +55,21 @@ Making changes on project using data from Azure Portal =
- this data which are "Application (client) id, Directory (tenant) id etc..." is created automatically
when creating SwaggerAzureADApi and uploaded to appsettings.json.

![SwaggerAzureADApi App regs](https://user-images.githubusercontent.com/57094137/210285097-b0dc9055-def3-4d04-a382-feeca68fd0c0.jpg)

RUN project whether it is working or not =
RUN project to check it is working or not =
------------------------------------------
- run get method and execute,
- if you get response as "Status Code 401", it is okay and we need to make some changes in Program.cs.

![Error 401](https://user-images.githubusercontent.com/57094137/210284937-710c53ce-bfda-4620-b65b-b09d291b90a0.jpg)

Making changes on Program.cs/StudentApp =
-----------------------------------------
- go to "builder.Services.AddSwaggerGen();" and add these codes to add OpenApiInfo & OpenApiSecurityScheme:

![AddSwaggerGen](https://user-images.githubusercontent.com/57094137/210285353-71bc8838-238f-4d49-8c1f-901f82e43c4b.jpg)

builder.Services.AddSwaggerGen(
c=>
{
Expand Down Expand Up @@ -119,6 +127,8 @@ Making changes on project/StudentApp =
--------------------------------------
- go to appsettings.json and add these codes from program.cs following "AzureAd" :

![VS App regs](https://user-images.githubusercontent.com/57094137/210285156-39e8a2ef-de27-4434-a763-d8705256eaf6.jpg)

"AzureAd": {
"Instance": "https://login.microsoftonline.com/",
"Domain": "11august22.onmicrosoft.com",
Expand All @@ -129,23 +139,23 @@ Making changes on project/StudentApp =
},
"SwaggerAzureAD": {
"AuthorizationUrl": "https://login.microsoftonline.com/d5af55b1-09d1-4c62-b91b-d108fd981704/oauth2/v2.0/authorize",
>>>> take this data from "SwaggerClientAppRegistration | Endpoints" (authorization endpoint(v2))
>> take this data from "SwaggerClientAppRegistration | Endpoints" (authorization endpoint(v2))

"TokenUrl": "https://login.microsoftonline.com/d5af55b1-09d1-4c62-b91b-d108fd981704/oauth2/v2.0/token",
>>>> take this data from "SwaggerClientAppRegistration | Endpoints" (token endpoint(v2))
>> take this data from "SwaggerClientAppRegistration | Endpoints" (token endpoint(v2))

"Scope": "api://a3f042ab-660c-4b16-92ee-6c1ea013f75e/access_as_user",
>>>> go to "SwaggerClientAppRegistration | API permissions",
>>>> click (+ Add a Permission) on the new page click "My APIs",
>>>> click project api name (exp. SwaggerAzureADApi) on the new page click "access_as_user",
>>>> on the same page click (Add permissions)
>>>> we are again on the "SwaggerClientAppRegistration | API permissions" page,
>>>> click "access_as_user" and on the new page copy data "api://......................."
>>>> paste this data to "Scope".
>> go to "SwaggerClientAppRegistration | API permissions",
>> click (+ Add a Permission) on the new page click "My APIs",
>> click project api name (exp. SwaggerAzureADApi) on the new page click "access_as_user",
>> on the same page click (Add permissions)
>> we are again on the "SwaggerClientAppRegistration | API permissions" page,
>> click "access_as_user" and on the new page copy data "api://......................."
>> paste this data to "Scope".


"ClientId": "e6e468b6-e2bd-405f-8808-40aef44b49da"
>>>> take this data from "SwaggerClientAppRegistration | Overview" section (Application (client) ID)
>> take this data from "SwaggerClientAppRegistration | Overview" section (Application (client) ID)

}

Expand All @@ -168,21 +178,26 @@ Making changes on Azure Portal =
- click (+ Add a platform)
- on the new page click ("Single-page application"),
- on the new opened page click ("Access tokens" and "ID tokens") but don't save because we need "Redirect URIs",
- so NOW, RUN program from Visual Studio/-code, !!!
- NOW, RUN program from Visual Studio/-code, !!!
and on the opened page copy the url (exp."https://localhost:7019/swagger")
- and paste it to "Redirect URIs" as (exp."https://localhost:7019/swagger/oauth2-redirect.html"),
- now you can click save/configure "Configure single-page application". Dont close RUNNING program. !!!


GO BACK TO Running program, Swagger page=
----------------------------------------
BACK TO Running program, Swagger page=
--------------------------------------
- Click ("Authorize") button,
- on the new page click data ("api://...................") under "Scopes" and then click "Authorize" button.
- on the new opened page Sign in with your account (account logging information in which you created SwaggerAzureADApi)
- on the new page give permission and click "Accept",
- now WE GOT TOKEN.

![Got Token](https://user-images.githubusercontent.com/57094137/210284617-5a4dd58f-d2f8-4c34-9fa5-ba21c21aa178.jpg)

- TURN TO running program, swagger page,
- RUN Methods (get/post/put/update/delete)
- NOW WE HAVE ACCESS TO DATA, GETTING RESPONSE, AND METHODS WORKING !!!!! :))

![Success 200](https://user-images.githubusercontent.com/57094137/210285257-fdc3b299-1be5-4d9f-9274-0072d637664e.jpg)

*******************************************************************************
7 changes: 6 additions & 1 deletion StudentApp-1.0.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33110.190
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StudentApp", "StudentApp\StudentApp.csproj", "{B42F1925-CAD9-41DE-877E-ECFDE1FB29FA}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StudentApp", "StudentApp\StudentApp.csproj", "{B42F1925-CAD9-41DE-877E-ECFDE1FB29FA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0BF9E2E4-6976-4061-AF81-649048F33541}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
7 changes: 7 additions & 0 deletions StudentApp/AzureStorage/IStorageService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

namespace StudentApp.AzureStorage;

public interface IStorageService
{
void Upload(IFormFile formFile);
};
25 changes: 25 additions & 0 deletions StudentApp/AzureStorage/StorageService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Azure.Storage.Blobs;
using StudentApp.Configurations;

namespace StudentApp.AzureStorage;

public class StorageService : IStorageService
{
private readonly BlobServiceClient _blobServiceClient;
private readonly IConfiguration _configuration;

public StorageService(BlobServiceClient blobServiceClient, IConfiguration configuration)
{
_blobServiceClient = blobServiceClient;
_configuration = configuration;
}

public void Upload(IFormFile formFile)
{
var containerName = _configuration.Get<AppConfig>().Storage.ContainerName;
var containerClient = _blobServiceClient.GetBlobContainerClient(containerName);
var blobClient = containerClient.GetBlobClient(formFile.FileName);
using var stream = formFile.OpenReadStream();
blobClient.Upload(stream, true);
}
}
11 changes: 11 additions & 0 deletions StudentApp/Configurations/AppConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

namespace StudentApp.Configurations;

public class AppConfig
{
public SqlServer SqlServer { get; set; }
public AzureAd AzureAd { get; set; }
public SwaggerAzureAD SwaggerAzureAD { get; set; }
public AppSettings AppSettings { get; set; }
public Storage Storage { get; set; }
}
8 changes: 8 additions & 0 deletions StudentApp/Configurations/AppSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

namespace StudentApp.Configurations;

public class AppSettings
{
public string RunPerMinute { get; init; }
public bool IsFakeValue { get; init; }
}
13 changes: 13 additions & 0 deletions StudentApp/Configurations/AzureAd.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

namespace StudentApp.Configurations;

public class AzureAd
{
public string Instance { get; set; } =
"https://login.microsoftonline.com/";
public string Domain { get; set; }
public string TenantId { get; set; }
public string ClientId { get; set; }
public string CallbackPath { get; set; }
public string Scopes { get; set; }
}
7 changes: 7 additions & 0 deletions StudentApp/Configurations/SqlServer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

namespace StudentApp.Configurations;

public class SqlServer
{
public string StudentAppContext { get; init; }
}
8 changes: 8 additions & 0 deletions StudentApp/Configurations/Storage.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

namespace StudentApp.Configurations;

public class Storage
{
public string ConnectionString { get; init; }
public string ContainerName { get; init; }
}
11 changes: 11 additions & 0 deletions StudentApp/Configurations/SwaggerAzureAD.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

namespace StudentApp.Configurations;

public class SwaggerAzureAD
{
public string AuthorizationUrl {get; set; } =
"https://login.microsoftonline.com/d5af55b1-09d1-4c62-b91b-d108fd981704/oauth2/v2.0/authorize";
public string TokenUrl { get; set;}
public string Scope { get; set;}
public string ClientId { get; set;}
}
45 changes: 21 additions & 24 deletions StudentApp/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@

using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc;
using StudentApp.Models;
using System.Diagnostics;

namespace StudentApp.Controllers
namespace StudentApp.Controllers;
public class HomeController : Controller
{
public class HomeController : Controller
{
private readonly ILogger<HomeController> _logger;
private readonly ILogger<HomeController> _logger;

public HomeController(ILogger<HomeController> logger)
{
_logger = logger;
}
public HomeController(ILogger<HomeController> logger)
{
_logger = logger;
}

public IActionResult Index()
{
return View();
}
public IActionResult Index()
{
return View();
}

public IActionResult Privacy()
{
return View();
}
public IActionResult Privacy()
{
return View();
}

[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
}
}
}
Loading