-
Notifications
You must be signed in to change notification settings - Fork 71
Project Completed!! #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
HKHemanthsharma
wants to merge
8
commits into
TheCSharpAcademy:main
Choose a base branch
from
HKHemanthsharma:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ed250e4
Project Completed!!
HKHemanthsharma 6e4c87f
Removed unused using Statements
HKHemanthsharma 51e92c9
Changed Variable Names to align with coding Conventions
HKHemanthsharma 5976b91
Created Readme
HKHemanthsharma 0ce77e8
Rename Readme to Readme.md
HKHemanthsharma 49d92c7
Updated Readme.md
HKHemanthsharma a393f43
adjusted the Spaces, removed the Unused Variables Codacy suggested.
HKHemanthsharma 329153e
Merge branch 'main' of https://github.com/HKHemanthsharma/CodeReviews…
HKHemanthsharma File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
ExerciseTracker.HemanthSharma/ExerciseTracker.HemanthSharma.sln
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| | ||
| Microsoft Visual Studio Solution File, Format Version 12.00 | ||
| # Visual Studio Version 17 | ||
| VisualStudioVersion = 17.12.35707.178 | ||
| MinimumVisualStudioVersion = 10.0.40219.1 | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExerciseTracker.HemanthSharma", "ExerciseTracker.HemanthSharma\ExerciseTracker.HemanthSharma.csproj", "{5CAB8E83-D604-455F-ACDF-0166CF575818}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Exercisetracker.UI", "Exercisetracker.UI\Exercisetracker.UI.csproj", "{0517394A-116F-4C1C-BCDA-6CFB1C867BB5}" | ||
| EndProject | ||
| Global | ||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
| Debug|Any CPU = Debug|Any CPU | ||
| Release|Any CPU = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
| {5CAB8E83-D604-455F-ACDF-0166CF575818}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {5CAB8E83-D604-455F-ACDF-0166CF575818}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {5CAB8E83-D604-455F-ACDF-0166CF575818}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {5CAB8E83-D604-455F-ACDF-0166CF575818}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {0517394A-116F-4C1C-BCDA-6CFB1C867BB5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {0517394A-116F-4C1C-BCDA-6CFB1C867BB5}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {0517394A-116F-4C1C-BCDA-6CFB1C867BB5}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {0517394A-116F-4C1C-BCDA-6CFB1C867BB5}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(SolutionProperties) = preSolution | ||
| HideSolutionNode = FALSE | ||
| EndGlobalSection | ||
| EndGlobal |
25 changes: 25 additions & 0 deletions
25
ExerciseTracker.HemanthSharma/ExerciseTracker.HemanthSharma/ContextClass.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| using ExerciseTracker.Study.Models; | ||
| using Microsoft.EntityFrameworkCore; | ||
|
|
||
| namespace ExerciseTracker.HemanthSharma; | ||
|
|
||
| public class ContextClass : DbContext | ||
| { | ||
| public ContextClass(DbContextOptions options) : base(options) { } | ||
| public DbSet<Exercise> Exercises { get; set; } | ||
| public DbSet<ExerciseShift> ExerciseShifts { get; set; } | ||
|
|
||
| protected override void OnModelCreating(ModelBuilder modelBuilder) | ||
| { | ||
| base.OnModelCreating(modelBuilder); | ||
| modelBuilder.Entity<Exercise>() | ||
| .HasKey(x => x.Id); | ||
| modelBuilder.Entity<Exercise>() | ||
| .HasMany(x => x.ExerciseShifts) | ||
| .WithOne(x => x.Exercise) | ||
| .HasForeignKey(x => x.ExerciseId); | ||
| modelBuilder.Entity<ExerciseShift>() | ||
| .HasKey(x => x.Id); | ||
| } | ||
| } | ||
|
|
60 changes: 60 additions & 0 deletions
60
...ciseTracker.HemanthSharma/ExerciseTracker.HemanthSharma/Controllers/ExerciseController.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| using ExerciseTracker.Study.Models; | ||
| using ExerciseTracker.Study.Models.DTO; | ||
| using ExerciseTracker.Study.Services; | ||
| using Microsoft.AspNetCore.Mvc; | ||
|
|
||
| namespace ExerciseTracker.Study.Controllers; | ||
|
|
||
| [Route("api/[controller]")] | ||
| [ApiController] | ||
| public class ExerciseController : ControllerBase | ||
| { | ||
| private readonly IService<Exercise> Service; | ||
| public ExerciseController(IService<Exercise> service) | ||
| { | ||
| Service = service; | ||
| } | ||
|
|
||
| [HttpGet] | ||
| public async Task<ActionResult<ResponseDto<Exercise>>> GetAllExercises() | ||
| { | ||
| return await Service.GetAll(); | ||
| } | ||
|
|
||
| [HttpGet] | ||
| [Route("{Id:int}")] | ||
| public async Task<ActionResult<ResponseDto<Exercise>>> GetExerciseById([FromRoute] int Id) | ||
| { | ||
| return await Service.GetById(Id); | ||
| } | ||
|
|
||
| [HttpPost] | ||
| public async Task<ActionResult<ResponseDto<Exercise>>> Create([FromBody] ExerciseDto NewExercise) | ||
| { | ||
|
|
||
| return await Service.Create(new Exercise | ||
| { | ||
| Name = NewExercise.Name | ||
| } | ||
| ); | ||
| } | ||
|
|
||
| [HttpPut] | ||
| [Route("{Id:int}")] | ||
| public async Task<ActionResult<ResponseDto<Exercise>>> Update([FromRoute] int Id, [FromBody] ExerciseDto UpdateExerciseDto) | ||
| { | ||
| Exercise UpdateExercise = new() | ||
| { | ||
| Id = Id, | ||
| Name = UpdateExerciseDto.Name | ||
| }; | ||
| return await Service.Update(UpdateExercise); | ||
| } | ||
|
|
||
| [HttpDelete] | ||
| [Route("{Id:int}")] | ||
| public async Task<ActionResult<ResponseDto<Exercise>>> Delete([FromRoute] int Id) | ||
| { | ||
| return await Service.Delete(Id); | ||
| } | ||
| } | ||
76 changes: 76 additions & 0 deletions
76
...racker.HemanthSharma/ExerciseTracker.HemanthSharma/Controllers/ExerciseShiftController.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| using ExerciseTracker.HemanthSharma.HelperMethods; | ||
| using ExerciseTracker.Study.Models; | ||
| using ExerciseTracker.Study.Models.DTO; | ||
| using ExerciseTracker.Study.Services; | ||
| using Microsoft.AspNetCore.Mvc; | ||
|
|
||
| namespace ExerciseTracker.Study.Controllers; | ||
|
|
||
| [Route("api/[controller]")] | ||
| [ApiController] | ||
| public class ExerciseShiftController : ControllerBase | ||
| { | ||
| private readonly IService<ExerciseShift> ShiftService; | ||
| public ExerciseShiftController(IService<ExerciseShift> service) | ||
| { | ||
| ShiftService = service; | ||
| } | ||
|
|
||
| [HttpGet] | ||
| public async Task<ActionResult<ResponseDto<ExerciseShift>>> GetAllShifts() | ||
| { | ||
| return await ShiftService.GetAll(); | ||
| } | ||
|
|
||
| [HttpGet] | ||
| [Route("{Id:int}")] | ||
| public async Task<ActionResult<ResponseDto<ExerciseShift>>> GetById([FromRoute] int Id) | ||
| { | ||
| return await ShiftService.GetById(Id); | ||
| } | ||
|
|
||
| [HttpPost] | ||
| public async Task<ActionResult<ResponseDto<ExerciseShift>>> CreateShift([FromBody] ExerciseShiftDto NewExerciseDto) | ||
| { | ||
| ExerciseShift NewExerciseShift = HelperClass.ConvertToExercise(NewExerciseDto); | ||
| if (NewExerciseShift == null) | ||
| { | ||
| return new ResponseDto<ExerciseShift> | ||
| { | ||
| IsSuccess = false, | ||
| Data = new List<ExerciseShift>(), | ||
| Message = "Bad Data! please check if The Shift Date and Times are in correct format", | ||
| ResponseMethod = "Post" | ||
| }; | ||
|
|
||
| } | ||
| return await ShiftService.Create(NewExerciseShift); | ||
| } | ||
|
|
||
| [HttpPut] | ||
| [Route("{Id:int}")] | ||
| public async Task<ActionResult<ResponseDto<ExerciseShift>>> UpdateShift([FromRoute] int Id, [FromBody] ExerciseShiftDto UpdateExerciseDto) | ||
| { | ||
| ExerciseShift UpdateExerciseShift = HelperClass.ConvertToExercise(UpdateExerciseDto); | ||
| if (UpdateExerciseShift == null) | ||
| { | ||
| return new ResponseDto<ExerciseShift> | ||
| { | ||
| IsSuccess = false, | ||
| Data = new List<ExerciseShift>(), | ||
| Message = "Bad Data! please check if The Shift Date and Times are in correct format", | ||
| ResponseMethod = "Post" | ||
| }; | ||
| } | ||
| UpdateExerciseShift.Id = Id; | ||
| return await ShiftService.Update(UpdateExerciseShift); | ||
| } | ||
|
|
||
| [HttpDelete] | ||
| [Route("{Id:int}")] | ||
| public async Task<ActionResult<ResponseDto<ExerciseShift>>> DeleteShift([FromRoute] int Id) | ||
| { | ||
|
|
||
| return await ShiftService.Delete(Id); | ||
| } | ||
| } |
7 changes: 7 additions & 0 deletions
7
ExerciseTracker.HemanthSharma/ExerciseTracker.HemanthSharma/DbSettings.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| namespace ExerciseTracker.Study; | ||
|
|
||
| public class DbSettings | ||
| { | ||
| public string Default { get; set; } | ||
| } | ||
|
|
21 changes: 21 additions & 0 deletions
21
...eTracker.HemanthSharma/ExerciseTracker.HemanthSharma/ExerciseTracker.HemanthSharma.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| <Nullable>enable</Nullable> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Dapper" Version="2.1.66" /> | ||
| <PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.6" /> | ||
| <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.6" /> | ||
| <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.6"> | ||
| <PrivateAssets>all</PrivateAssets> | ||
| <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
| </PackageReference> | ||
| <PackageReference Include="Spectre.Console" Version="0.50.0" /> | ||
| <PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
6 changes: 6 additions & 0 deletions
6
...iseTracker.HemanthSharma/ExerciseTracker.HemanthSharma/ExerciseTracker.HemanthSharma.http
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| @ExerciseTracker.HemanthSharma_HostAddress = http://localhost:5086 | ||
|
|
||
| GET {{ExerciseTracker.HemanthSharma_HostAddress}}/weatherforecast/ | ||
| Accept: application/json | ||
|
|
||
| ### |
30 changes: 30 additions & 0 deletions
30
ExerciseTracker.HemanthSharma/ExerciseTracker.HemanthSharma/HelperMethods/HelperClass.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| using ExerciseTracker.Study.Models; | ||
| using ExerciseTracker.Study.Models.DTO; | ||
| using ExerciseTracker.Study.ValidationsMethods; | ||
|
|
||
| namespace ExerciseTracker.HemanthSharma.HelperMethods; | ||
|
|
||
| public class HelperClass | ||
| { | ||
| public static ExerciseShift ConvertToExercise(ExerciseShiftDto ExerciseDto) | ||
| { | ||
| if (!Validations.ValidTime(ExerciseDto.StartTime) || !Validations.ValidTime(ExerciseDto.EndTime) || !Validations.ValidDate(ExerciseDto.ExerciseDate)) | ||
| { | ||
| return null; | ||
| } | ||
|
|
||
| DateTime ShiftStartTime = DateTime.ParseExact(ExerciseDto.StartTime, "HH:mm", null); | ||
| DateTime ShiftEndTime = DateTime.ParseExact(ExerciseDto.EndTime, "HH:mm", null); | ||
| DateTime ShiftDate = DateTime.ParseExact(ExerciseDto.ExerciseDate, "dd-MM-yyyy", null); | ||
|
|
||
| ExerciseShift NewExercise = new ExerciseShift | ||
| { | ||
| ExerciseId = ExerciseDto.ExerciseId, | ||
| StartTime = ShiftStartTime, | ||
| EndTime = ShiftEndTime, | ||
| Comments = ExerciseDto.Comments, | ||
| ExerciseDate = ShiftDate | ||
| }; | ||
| return NewExercise; | ||
| } | ||
| } |
6 changes: 6 additions & 0 deletions
6
ExerciseTracker.HemanthSharma/ExerciseTracker.HemanthSharma/Interfaces/IEntity.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| namespace ExerciseTracker.HemanthSharma.Interfaces; | ||
|
|
||
| public interface IEntity<T> | ||
| { | ||
| int Id { get; set; } | ||
| } |
6 changes: 6 additions & 0 deletions
6
ExerciseTracker.HemanthSharma/ExerciseTracker.HemanthSharma/Models/DTO/ExerciseDto.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| namespace ExerciseTracker.Study.Models.DTO; | ||
|
|
||
| public class ExerciseDto | ||
| { | ||
| public string Name { get; set; } | ||
| } |
16 changes: 16 additions & 0 deletions
16
ExerciseTracker.HemanthSharma/ExerciseTracker.HemanthSharma/Models/DTO/ExerciseShiftDto.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| using System.ComponentModel.DataAnnotations; | ||
|
|
||
| namespace ExerciseTracker.Study.Models.DTO | ||
| { | ||
| public class ExerciseShiftDto | ||
| { | ||
| public int ExerciseId { get; set; } | ||
| [RegularExpression(@"^(0?[0-9]|1[0-9]|2[0-3]):[0-5]\d$")] | ||
| public string StartTime { get; set; } | ||
| [RegularExpression(@"^(0?[0-9]|1[0-9]|2[0-3]):[0-5]\d$")] | ||
| public string EndTime { get; set; } | ||
| [RegularExpression(@"^(0[1-9]|[12][0-9]|3[01])-(0[1-9]|1[0-2])-(19|20)\d{2}$")] | ||
| public string ExerciseDate { get; set; } | ||
| public string? Comments { get; set; } | ||
| } | ||
| } |
19 changes: 19 additions & 0 deletions
19
ExerciseTracker.HemanthSharma/ExerciseTracker.HemanthSharma/Models/DTO/ResponseDto.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| namespace ExerciseTracker.Study.Models.DTO; | ||
|
|
||
| public class ResponseDto<T> | ||
| { | ||
| public bool IsSuccess { get; set; } | ||
| public string ResponseMethod { get; set; } | ||
| public string Message { get; set; } | ||
| public List<T>? Data { get; set; } | ||
| public ResponseDto<T> CreateResponse(bool IsSuccess, string Message, string method, List<T>? Data) | ||
| { | ||
| return new ResponseDto<T> | ||
| { | ||
| IsSuccess = IsSuccess, | ||
| Message = Message, | ||
| ResponseMethod = method, | ||
| Data = Data | ||
| }; | ||
| } | ||
| } |
12 changes: 12 additions & 0 deletions
12
ExerciseTracker.HemanthSharma/ExerciseTracker.HemanthSharma/Models/Exercise.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| using ExerciseTracker.HemanthSharma.Interfaces; | ||
| using System.Text.Json.Serialization; | ||
|
|
||
| namespace ExerciseTracker.Study.Models; | ||
|
|
||
| public class Exercise : IEntity<Exercise> | ||
| { | ||
| public int Id { get; set; } | ||
| public string Name { get; set; } | ||
| [JsonIgnore] | ||
| public List<ExerciseShift>? ExerciseShifts { get; set; } | ||
| } |
15 changes: 15 additions & 0 deletions
15
ExerciseTracker.HemanthSharma/ExerciseTracker.HemanthSharma/Models/ExerciseShift.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| using ExerciseTracker.HemanthSharma.Interfaces; | ||
|
|
||
| namespace ExerciseTracker.Study.Models; | ||
|
|
||
| public class ExerciseShift : IEntity<ExerciseShift> | ||
| { | ||
| public int Id { get; set; } | ||
| public int ExerciseId { get; set; } | ||
| public DateTime StartTime { get; set; } | ||
| public DateTime EndTime { get; set; } | ||
| public DateTime ExerciseDate { get; set; } | ||
| public int Duration => (int)(EndTime - StartTime).TotalMinutes; | ||
| public string? Comments { get; set; } | ||
| public Exercise Exercise { get; set; } | ||
| } |
48 changes: 48 additions & 0 deletions
48
ExerciseTracker.HemanthSharma/ExerciseTracker.HemanthSharma/Program.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
|
|
||
| using ExerciseTracker.Study; | ||
| using ExerciseTracker.Study.Models; | ||
| using ExerciseTracker.Study.Repositories; | ||
| using ExerciseTracker.Study.Services; | ||
| using Microsoft.EntityFrameworkCore; | ||
|
|
||
| namespace ExerciseTracker.HemanthSharma; | ||
|
|
||
| public class Program | ||
| { | ||
| public static void Main(string[] args) | ||
| { | ||
| var builder = WebApplication.CreateBuilder(args); | ||
|
|
||
| // Add services to the container. | ||
|
|
||
| builder.Services.AddControllers(); | ||
| // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle | ||
| builder.Services.AddEndpointsApiExplorer(); | ||
| builder.Services.AddSwaggerGen(); | ||
| builder.Services.AddDbContext<ContextClass>(options => options.UseSqlServer(builder.Configuration.GetConnectionString("Default"))); | ||
| builder.Services.AddScoped<IRepository<Exercise>, RepositoryDapper>(); | ||
| builder.Services.AddScoped<IRepository<ExerciseShift>, RepositoryClass<ExerciseShift>>(); | ||
| builder.Services.AddScoped<IService<Exercise>, ServiceClass<Exercise>>(); | ||
| builder.Services.AddScoped<IService<ExerciseShift>, ServiceClass<ExerciseShift>>(); | ||
| builder.Services.Configure<DbSettings>(builder.Configuration.GetSection("ConnectionStrings")); | ||
|
|
||
| var app = builder.Build(); | ||
|
|
||
| // Configure the HTTP request pipeline. | ||
| if (app.Environment.IsDevelopment()) | ||
| { | ||
| app.UseSwagger(); | ||
| app.UseSwaggerUI(); | ||
| } | ||
|
|
||
| app.UseHttpsRedirection(); | ||
|
|
||
| app.UseAuthorization(); | ||
|
|
||
|
|
||
| app.MapControllers(); | ||
|
|
||
| app.Run(); | ||
| } | ||
| } | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 Code Style
💡 As we are onto the more advanced projects. I will need you to conform to the Academy's code-conventions
❗ Take note of the Spacing section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @chrisjamiecarter Thank you for the review, I have adjusted the code to follow code-conventions, added necessary spacings to make code more readable and removed few unused variables flagged by codacy. Please let me know if i have to make any changes Thanks.