Skip to content

Commit

Permalink
updatedFootballerEntity
Browse files Browse the repository at this point in the history
  • Loading branch information
emrekurtarr committed Dec 4, 2021
1 parent 576af9d commit 6f4db6c
Show file tree
Hide file tree
Showing 82 changed files with 778 additions and 97 deletions.
Binary file modified Week7/FootballManager/.vs/FootballManager/v16/.suo
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
using Microsoft.AspNetCore.Http;
using AutoMapper;
using FootballManager.Entities;
using FootballManager.Service.DTOs.Footballer;
using FootballManager.Service.Interfaces;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
Expand All @@ -11,8 +15,29 @@ namespace FootballManager.API.Controllers
[ApiController]
public class FootballerController : ControllerBase
{
private IFootballerService _footballerService;
private IMapper _mapper;


public FootballerController(IFootballerService footballerService,IMapper mapper)
{
_footballerService = footballerService;
_mapper = mapper;
}

[HttpPost]
public async Task<IActionResult> AddFootballer(AddFootballerDTO footballerdto)
{
await _footballerService.AddAsync(_mapper.Map<Footballer>(footballerdto));
return Ok();
}

[HttpPut]
public IActionResult UpdateFootballer(UpdateFootballerDTO footballerdto)
{

_footballerService.Update(_mapper.Map<Footballer>(footballerdto));
return Ok();
}


}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AutoMapper" Version="10.1.1" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="8.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.12" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.12">
<PrivateAssets>all</PrivateAssets>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using AutoMapper;
using FootballManager.Entities;
using FootballManager.Service.DTOs.Footballer;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace FootballManager.API.Mapping
{
public class FootballerProfile : Profile
{
public FootballerProfile()
{
CreateMap<Footballer, AddFootballerDTO>().ReverseMap();
CreateMap<Footballer, UpdateFootballerDTO>().ReverseMap();
}
}
}
9 changes: 6 additions & 3 deletions Week7/FootballManager/FootballManager.API/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,20 @@ public Startup(IConfiguration configuration)

public IConfiguration Configuration { get; }

// This method gets called by the runtime. Use this method to add services to the container.

public void ConfigureServices(IServiceCollection services)
{

// My service extensions
services.AddMyContext(Configuration);
services.AddMyServices();
services.AddUnitOfWorkService();

//AutoMapper
services.AddAutoMapper(typeof(Startup));
services.AddControllers();
}

// 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())
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
".NETCoreApp,Version=v5.0": {
"FootballManager.API/1.0.0": {
"dependencies": {
"AutoMapper": "10.1.1",
"AutoMapper.Extensions.Microsoft.DependencyInjection": "8.1.1",
"FootballManager.Service": "1.0.0",
"Microsoft.EntityFrameworkCore": "5.0.12",
"Microsoft.EntityFrameworkCore.Design": "5.0.12",
Expand Down Expand Up @@ -321,6 +323,37 @@
"FootballManager.API.dll": {}
}
},
"AutoMapper/10.1.1": {
"dependencies": {
"Microsoft.CSharp": "4.7.0",
"System.Reflection.Emit": "4.7.0"
},
"runtime": {
"lib/netstandard2.0/AutoMapper.dll": {
"assemblyVersion": "10.0.0.0",
"fileVersion": "10.1.1.0"
}
},
"compile": {
"lib/netstandard2.0/AutoMapper.dll": {}
}
},
"AutoMapper.Extensions.Microsoft.DependencyInjection/8.1.1": {
"dependencies": {
"AutoMapper": "10.1.1",
"Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0",
"Microsoft.Extensions.Options": "5.0.0"
},
"runtime": {
"lib/netstandard2.0/AutoMapper.Extensions.Microsoft.DependencyInjection.dll": {
"assemblyVersion": "8.0.0.0",
"fileVersion": "8.1.1.0"
}
},
"compile": {
"lib/netstandard2.0/AutoMapper.Extensions.Microsoft.DependencyInjection.dll": {}
}
},
"Humanizer.Core/2.8.26": {
"runtime": {
"lib/netstandard2.0/Humanizer.dll": {
Expand Down Expand Up @@ -877,7 +910,7 @@
"System.Linq.Expressions": "4.3.0",
"System.ObjectModel": "4.3.0",
"System.Reflection": "4.3.0",
"System.Reflection.Emit": "4.3.0",
"System.Reflection.Emit": "4.7.0",
"System.Reflection.Emit.ILGeneration": "4.3.0",
"System.Reflection.Primitives": "4.3.0",
"System.Reflection.TypeExtensions": "4.3.0",
Expand Down Expand Up @@ -964,7 +997,7 @@
"System.Linq": "4.3.0",
"System.ObjectModel": "4.3.0",
"System.Reflection": "4.3.0",
"System.Reflection.Emit": "4.3.0",
"System.Reflection.Emit": "4.7.0",
"System.Reflection.Emit.ILGeneration": "4.3.0",
"System.Reflection.Emit.Lightweight": "4.3.0",
"System.Reflection.Extensions": "4.3.0",
Expand Down Expand Up @@ -1056,15 +1089,7 @@
"System.Runtime": "4.3.0"
}
},
"System.Reflection.Emit/4.3.0": {
"dependencies": {
"System.IO": "4.3.0",
"System.Reflection": "4.3.0",
"System.Reflection.Emit.ILGeneration": "4.3.0",
"System.Reflection.Primitives": "4.3.0",
"System.Runtime": "4.3.0"
}
},
"System.Reflection.Emit/4.7.0": {},
"System.Reflection.Emit.ILGeneration/4.3.0": {
"dependencies": {
"System.Reflection": "4.3.0",
Expand Down Expand Up @@ -1396,7 +1421,7 @@
"System.IO": "4.3.0",
"System.Linq": "4.3.0",
"System.Reflection": "4.3.0",
"System.Reflection.Emit": "4.3.0",
"System.Reflection.Emit": "4.7.0",
"System.Reflection.Emit.ILGeneration": "4.3.0",
"System.Reflection.Extensions": "4.3.0",
"System.Reflection.Primitives": "4.3.0",
Expand Down Expand Up @@ -1444,6 +1469,8 @@
},
"FootballManager.Service/1.0.0": {
"dependencies": {
"AutoMapper": "10.1.1",
"AutoMapper.Extensions.Microsoft.DependencyInjection": "8.1.1",
"FootballManager.Data": "1.0.0",
"Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0",
"System.Configuration.ConfigurationManager": "6.0.0"
Expand Down Expand Up @@ -3125,6 +3152,20 @@
"serviceable": false,
"sha512": ""
},
"AutoMapper/10.1.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-uMgbqOdu9ZG5cIOty0C85hzzayBH2i9BthnS5FlMqKtMSHDv4ts81a2jS1VFaDBVhlBeIqJ/kQKjQY95BZde9w==",
"path": "automapper/10.1.1",
"hashPath": "automapper.10.1.1.nupkg.sha512"
},
"AutoMapper.Extensions.Microsoft.DependencyInjection/8.1.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-xSWoVzOipuDU4PeZcUfaZQ+xqXU8QmGv5jrdlxt3MYm9xaOmrefqcfzGQ3SQ+D+8wfBa/ZwSuL0qKOVj080inA==",
"path": "automapper.extensions.microsoft.dependencyinjection/8.1.1",
"hashPath": "automapper.extensions.microsoft.dependencyinjection.8.1.1.nupkg.sha512"
},
"Humanizer.Core/2.8.26": {
"type": "package",
"serviceable": true,
Expand Down Expand Up @@ -3559,12 +3600,12 @@
"path": "system.reflection/4.3.0",
"hashPath": "system.reflection.4.3.0.nupkg.sha512"
},
"System.Reflection.Emit/4.3.0": {
"System.Reflection.Emit/4.7.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-228FG0jLcIwTVJyz8CLFKueVqQK36ANazUManGaJHkO0icjiIypKW7YLWLIWahyIkdh5M7mV2dJepllLyA1SKg==",
"path": "system.reflection.emit/4.3.0",
"hashPath": "system.reflection.emit.4.3.0.nupkg.sha512"
"sha512": "sha512-VR4kk8XLKebQ4MZuKuIni/7oh+QGFmZW3qORd1GvBq/8026OpW501SzT/oypwiQl4TvT8ErnReh/NzY9u+C6wQ==",
"path": "system.reflection.emit/4.7.0",
"hashPath": "system.reflection.emit.4.7.0.nupkg.sha512"
},
"System.Reflection.Emit.ILGeneration/4.3.0": {
"type": "package",
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ec0c9f9616413a3e870e39be02cabdc6e28948e1
3fba9741251c0631b0ced8a9aa8468e0da6938c3
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,5 @@ C:\Users\Allthebest\Desktop\InveonHomeworks\Week7\FootballManager\FootballManage
C:\Users\Allthebest\Desktop\InveonHomeworks\Week7\FootballManager\FootballManager.API\bin\Debug\net5.0\Microsoft.EntityFrameworkCore.Design.dll
C:\Users\Allthebest\Desktop\InveonHomeworks\Week7\FootballManager\FootballManager.API\bin\Debug\net5.0\FootballManager.Core.dll
C:\Users\Allthebest\Desktop\InveonHomeworks\Week7\FootballManager\FootballManager.API\bin\Debug\net5.0\FootballManager.Core.pdb
C:\Users\Allthebest\Desktop\InveonHomeworks\Week7\FootballManager\FootballManager.API\bin\Debug\net5.0\AutoMapper.dll
C:\Users\Allthebest\Desktop\InveonHomeworks\Week7\FootballManager\FootballManager.API\bin\Debug\net5.0\AutoMapper.Extensions.Microsoft.DependencyInjection.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@
"net5.0": {
"targetAlias": "net5.0",
"dependencies": {
"AutoMapper": {
"target": "Package",
"version": "[10.1.1, )"
},
"AutoMapper.Extensions.Microsoft.DependencyInjection": {
"target": "Package",
"version": "[8.1.1, )"
},
"Microsoft.EntityFrameworkCore": {
"target": "Package",
"version": "[5.0.12, )"
Expand Down Expand Up @@ -323,6 +331,14 @@
"net5.0": {
"targetAlias": "net5.0",
"dependencies": {
"AutoMapper": {
"target": "Package",
"version": "[10.1.1, )"
},
"AutoMapper.Extensions.Microsoft.DependencyInjection": {
"target": "Package",
"version": "[8.1.1, )"
},
"Microsoft.Extensions.DependencyInjection.Abstractions": {
"target": "Package",
"version": "[6.0.0, )"
Expand Down
Loading

0 comments on commit 6f4db6c

Please sign in to comment.