├── .gitattributes ├── .gitignore ├── Business ├── Abstract │ ├── IAuthService.cs │ ├── IBrandService.cs │ ├── ICarImageService.cs │ ├── ICarService.cs │ ├── IColorService.cs │ ├── ICreditCardService.cs │ ├── ICustomerService.cs │ ├── IFindexService.cs │ ├── IPaymentService.cs │ ├── IRentalService.cs │ └── IUserService.cs ├── Attributes │ └── RentValidationAttribute.cs ├── Business.csproj ├── BusinessAspects │ └── Autofac │ │ └── SecuredOperation.cs ├── Concrete │ ├── AuthManager.cs │ ├── BrandManager.cs │ ├── CarImageManager.cs │ ├── CarManager.cs │ ├── ColorManager.cs │ ├── CreditCardManager.cs │ ├── CustomerManager.cs │ ├── FindexManager.cs │ ├── PaymentManager.cs │ ├── RentalManager.cs │ └── UserManager.cs ├── Constant │ ├── FilePath.cs │ └── Messages.cs ├── DependencyResolvers │ ├── AutoFac │ │ └── AutofacBusinessModule.cs │ └── Ninject │ │ ├── BusinessModule.cs │ │ └── InstanceFactory.cs ├── HandleException │ ├── HandleException.cs │ └── IException.cs └── ValidationRules │ └── FluentValidation │ ├── BrandValidator.cs │ ├── CarValidator.cs │ ├── ColorValidator.cs │ ├── RentalValidator.cs │ └── UserValidator.cs ├── ConsoleUI ├── ConsoleUI.csproj ├── IConsoleUI.cs ├── Program.cs └── RentaCar.cs ├── Core ├── Aspects │ ├── Autofac │ │ ├── Caching │ │ │ ├── CacheAspect.cs │ │ │ └── CacheRemoveAspect.cs │ │ ├── CancellationToken │ │ │ └── CancellationTokenAspect.cs │ │ ├── Performance │ │ │ └── PerformanceAspect.cs │ │ ├── Transaction │ │ │ └── TransactionScopeAspect.cs │ │ └── Validation │ │ │ └── ValidationAspect.cs │ └── MyAspects │ │ └── MyAspect.cs ├── Core.csproj ├── CrossCuttingConcerns │ ├── Caching │ │ ├── ICacheManager.cs │ │ └── Microsoft │ │ │ └── MemoryCacheManager.cs │ └── Validation │ │ └── FluentValidation │ │ └── ValidationTool.cs ├── DataAccess │ ├── EntityFramework │ │ └── EfEntityRepositoryBase.cs │ └── IEntityRepository.cs ├── DependencyResolvers │ └── Autofac │ │ └── CoreModule.cs ├── Entities │ ├── Concrete │ │ ├── OperationClaim.cs │ │ ├── User.cs │ │ └── UserOperationClaim.cs │ ├── IDto.cs │ └── IEntity.cs ├── Extensions │ ├── ClaimExtensions.cs │ ├── ClaimsPrincipalExtensions.cs │ ├── ErrorDetails.cs │ ├── ExceptionMiddleware.cs │ ├── ExceptionMiddlewareExtensions.cs │ └── ServiceCollectionExtensions.cs └── Utilities │ ├── Business │ └── BusinessRules.cs │ ├── File │ ├── Abstract │ │ ├── IFileProp.cs │ │ ├── IFileUtilities.cs │ │ ├── IFormFileProp.cs │ │ └── IImageSaveBase.cs │ └── Concrete │ │ ├── AbcSave.cs │ │ ├── Base │ │ └── ImageSaveBase.cs │ │ ├── FileUtilities.cs │ │ ├── FormFileImageSave.cs │ │ ├── FormFilesImageSave.cs │ │ ├── MusicSave.cs │ │ ├── NormalImageSave.cs │ │ └── Prop │ │ ├── FileProp.cs │ │ ├── FormFileProp.cs │ │ └── MusicProp.cs │ ├── Interceptors │ ├── AspectInterceptorSelector.cs │ ├── MethodInterception.cs │ └── MethodInterceptionBaseAttribute.cs │ ├── IoC │ ├── ICoreModule.cs │ └── ServiceTool.cs │ ├── Messages │ └── AspectMessages.cs │ ├── Results │ ├── Abstract │ │ ├── IDataResult.cs │ │ └── IResult.cs │ ├── Concrate │ │ ├── DataResult │ │ │ ├── DataResult.cs │ │ │ ├── ErrorDataResult.cs │ │ │ └── SuccessDataResult.cs │ │ └── Result │ │ │ ├── ErrorResult.cs │ │ │ ├── Result.cs │ │ │ └── SuccessResult.cs │ └── Notes.txt │ └── Security │ ├── Encryption │ ├── SecurityKeyHelper.cs │ └── SigningCredentialsHelper.cs │ ├── Hashing │ └── HashingHelper.cs │ └── Jwt │ ├── AccessToken.cs │ ├── ITokenHelper.cs │ ├── JwtHelper.cs │ └── TokenOptions.cs ├── DataAccess ├── Abstract │ ├── IBrandDal.cs │ ├── ICarDal.cs │ ├── ICarImageDal.cs │ ├── IColorDal.cs │ ├── ICreditCardDal.cs │ ├── ICustomerDal.cs │ ├── IFindexDal.cs │ ├── IRentalDal.cs │ └── IUserDal.cs ├── Concrete │ ├── EntityFramework │ │ ├── EfBrandDal.cs │ │ ├── EfCarDal.cs │ │ ├── EfCarImageDal.cs │ │ ├── EfColorDal.cs │ │ ├── EfCreditCardDal.cs │ │ ├── EfCustomerDal.cs │ │ ├── EfFindexDal.cs │ │ ├── EfRentalDal.cs │ │ ├── EfUserDal.cs │ │ └── ReCapDemoContext.cs │ └── InMemory │ │ └── InMemoryCarDal.cs └── DataAccess.csproj ├── Entities ├── Concrete │ ├── Brand.cs │ ├── Car.cs │ ├── CarImage.cs │ ├── Color.cs │ ├── CreditCard.cs │ ├── Customer.cs │ ├── Findex.cs │ ├── Payment.cs │ └── Rental.cs ├── Dtos │ ├── CarDetailDto.cs │ ├── CarImageDetailDto.cs │ ├── CarImageFormFile.cs │ ├── CustomerDetailDto.cs │ ├── RentalDetailDto.cs │ ├── UserForLoginDto.cs │ └── UserForRegisterDto.cs └── Entities.csproj ├── README.md ├── ReCapProject.sln ├── Storage ├── CarImages │ ├── 06cadb47-2e26-47a5-beea-140094296a78.jpg │ ├── 0a6a6319-93e6-4777-87c2-39dd660c9fdb.jpg │ ├── 0dd898f8-2258-48a9-baf5-8a0bb748a908.jpg │ ├── 10a7e68c-d0fe-4318-bbac-ebe3cc6cdfee.jpg │ ├── 1174d4c9-acab-42f6-800d-f1f4bf8511c1.jpg │ ├── 11b48bad-045d-4206-be73-75d4fe16b6a0.jpg │ ├── 17b8597d-36f6-4c0f-b7d8-aa7bcf090987.jpg │ ├── 1b07e30e-a48d-43d8-a63e-473bf46020c4.jpg │ ├── 1f2cd81e-d0bd-4f59-94a2-070dd6f5ae2d.jpg │ ├── 1ff56a2b-aa47-493b-8b2b-cbfa0a5774ba.jpg │ ├── 20a8c9f1-4291-469d-966d-4cb17cdf7fa8.png │ ├── 22958191-3702-489f-822b-c5bff11dfa51.jpg │ ├── 26c46d24-ccf0-4ccb-bcf6-a2b661d181b8.jpg │ ├── 2a1085b0-9605-47b4-a51d-95055418b270.jpg │ ├── 3a558fe6-156c-43fb-8989-d632d4acd5f5.jpg │ ├── 3a96b150-b5b7-4f04-8669-f86d8e380c80.jpg │ ├── 40fcd418-fe6a-4a04-9bdc-23beee2edf56.jpg │ ├── 4eaca2e1-852a-4c98-aa31-afc185d8733c.jpg │ ├── 50c2692d-9e2d-4df3-8cab-4a1a05623dbc.jpg │ ├── 51219c8e-6e05-40e3-b6e8-413285158a54.jpg │ ├── 61092f87-7d71-4f2d-bcef-8d0835c48916.jpg │ ├── 68105f6c-4828-4631-b422-330d795126cb.jpg │ ├── 69009443-068e-4945-b4b6-4b3cd9116651.jpg │ ├── 6aab46a6-d98a-4714-975c-b575f077d8c1.jpg │ ├── 6bea425f-428c-480e-93a6-76551abfe22b.jpg │ ├── 7e3dba04-d81b-4e56-9b2c-885ee3b8bc77.jpg │ ├── 7ea088bb-f66d-4e96-8c5c-6d395b3a41ad.jpg │ ├── 8e6d33c5-a867-478c-b393-ecf22123d3bf.jpg │ ├── 915acba9-878b-458e-8b7f-f4f36294aee5.jpg │ ├── 96857e74-8f60-4a76-995f-5c54867e86dc.jpg │ ├── 9afc4068-36af-4029-bbb9-5040b1621930.jpg │ ├── RentACarImageDefault.jpg │ ├── a8d779b4-e8ce-46b2-823b-e95bd89f48cd.jpg │ ├── b11b2eca-ed36-41c4-bc8c-1beeef84a211.jpg │ ├── c0b96b83-e12e-4aef-a8d8-136ee2a34564.png │ ├── c1894752-de9e-4005-bdfe-336390ae6626.jpg │ ├── c1f6885e-e201-463f-9f94-6f857c02fdcd.jpg │ ├── c53a7219-aec8-4f66-ac0d-5a1bcae6b61d.jpg │ ├── c699d0e7-188e-40bc-bfe4-4ef3c0a49c34.jpg │ ├── c7488adb-691c-4fc5-8da2-ab53a36d2e42.png │ ├── c8270866-2699-4f08-b3d4-c96f3632e375.jpg │ ├── c9b2a485-2c6e-409b-b30c-cd599ebb08c7.jpg │ ├── d7319707-b9da-4fc3-863f-929a26024a88.jpg │ ├── d8ed4519-06a4-465b-af58-35e48e2a67ac.jpg │ ├── e4a05474-f6ca-4edb-a34c-707ed6833d2b.jpg │ ├── e57293ae-d13d-4d55-9e2f-de284869c442.jpg │ ├── enes.txt │ ├── enes1.txt │ ├── f37e128a-ceb2-49b7-8518-8245cd5ce6d7.jpg │ ├── f51f4a58-af0c-4c54-afea-852e67aff658.jpg │ ├── f9625188-e9f6-4266-b364-410719041336.jpg │ └── fd502c3d-beaa-4673-a915-24f47b2dbbab.jpg ├── Storage.csproj ├── StorageControl.cs └── StorageFilePath.cs └── WebAPI ├── Controllers ├── AuthController.cs ├── BrandsController.cs ├── CarImagesController.cs ├── CarsController.cs ├── ColorsController.cs ├── CrediCardsController.cs ├── CustomersController.cs ├── FindeksController.cs ├── PaymentsController.cs ├── RentalsController.cs └── UsersController.cs ├── Program.cs ├── Properties └── launchSettings.json ├── Startup.cs ├── WeatherForecast.cs ├── WebAPI.csproj ├── appsettings.Development.json ├── appsettings.json └── wwwroot └── Temp ├── 06cadb47-2e26-47a5-beea-140094296a78.jpg ├── 10a7e68c-d0fe-4318-bbac-ebe3cc6cdfee.jpg ├── 1b07e30e-a48d-43d8-a63e-473bf46020c4.jpg ├── 1f2cd81e-d0bd-4f59-94a2-070dd6f5ae2d.jpg ├── 20a8c9f1-4291-469d-966d-4cb17cdf7fa8.png ├── 22958191-3702-489f-822b-c5bff11dfa51.jpg ├── 26c46d24-ccf0-4ccb-bcf6-a2b661d181b8.jpg ├── 284f32ca-a7e8-4bdb-b4e3-4b5692b61711.jpg ├── 3a96b150-b5b7-4f04-8669-f86d8e380c80.jpg ├── 40fcd418-fe6a-4a04-9bdc-23beee2edf56.jpg ├── 4eaca2e1-852a-4c98-aa31-afc185d8733c.jpg ├── 51219c8e-6e05-40e3-b6e8-413285158a54.jpg ├── 61092f87-7d71-4f2d-bcef-8d0835c48916.jpg ├── 69009443-068e-4945-b4b6-4b3cd9116651.jpg ├── 6aab46a6-d98a-4714-975c-b575f077d8c1.jpg ├── 6bea425f-428c-480e-93a6-76551abfe22b.jpg ├── 8e6d33c5-a867-478c-b393-ecf22123d3bf.jpg ├── 96857e74-8f60-4a76-995f-5c54867e86dc.jpg ├── RentACarImageDefault.jpg ├── b11b2eca-ed36-41c4-bc8c-1beeef84a211.jpg ├── c0b96b83-e12e-4aef-a8d8-136ee2a34564.png ├── c1894752-de9e-4005-bdfe-336390ae6626.jpg ├── c53a7219-aec8-4f66-ac0d-5a1bcae6b61d.jpg ├── c8270866-2699-4f08-b3d4-c96f3632e375.jpg ├── c9b2a485-2c6e-409b-b30c-cd599ebb08c7.jpg ├── e4a05474-f6ca-4edb-a34c-707ed6833d2b.jpg ├── f37e128a-ceb2-49b7-8518-8245cd5ce6d7.jpg ├── f51f4a58-af0c-4c54-afea-852e67aff658.jpg ├── f9625188-e9f6-4266-b364-410719041336.jpg └── fd502c3d-beaa-4673-a915-24f47b2dbbab.jpg /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /Business/Abstract/IAuthService.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities.Concrete; 2 | using Core.Utilities.Results.Abstract; 3 | using Core.Utilities.Security.Jwt; 4 | using Entities.Dtos; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Text; 8 | 9 | namespace Business.Abstract 10 | { 11 | public interface IAuthService 12 | { 13 | IDataResult Register(UserForRegisterDto userForRegisterDto, string password); 14 | IDataResult Login(UserForLoginDto userForLoginDto); 15 | IResult UserExists(string email); 16 | IDataResult CreateAccessToken(User user); 17 | IDataResult ValidateToken(string authToken); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Business/Abstract/IBrandService.cs: -------------------------------------------------------------------------------- 1 | using Core.Utilities.Results.Abstract; 2 | using Entities.Concrete; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace Business.Abstract 8 | { 9 | public interface IBrandService 10 | { 11 | IDataResult> GetAll(); 12 | IResult Add(Brand brand); 13 | IResult Update(Brand brand); 14 | IResult Delete(Brand brand); 15 | IDataResult GetById(int brandID); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Business/Abstract/ICarImageService.cs: -------------------------------------------------------------------------------- 1 | using Core.Utilities.Results.Abstract; 2 | using Entities.Concrete; 3 | using Entities.Dtos; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.IO; 7 | using System.Text; 8 | using static Core.Utilities.File.FileUtilities; 9 | 10 | namespace Business.Abstract 11 | { 12 | public interface ICarImageService 13 | { 14 | IResult ImageSaveBase(ImageSaveBase imageSaveBase); 15 | IDataResult> GetAll(); 16 | IResult Add(CarImage carImage); 17 | IResult AddFormFile(CarImage carImage); 18 | IResult AddFormFileBatch(CarImage carImage); 19 | IResult Update(CarImage carImage); 20 | IResult Delete(CarImage carImage); 21 | IDataResult GetById(int id); 22 | IDataResult View(int id, string url); 23 | IResult AddTransactionalTest(CarImage carImage); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Business/Abstract/ICarService.cs: -------------------------------------------------------------------------------- 1 | using Core.Utilities.Results.Abstract; 2 | using Entities.Concrete; 3 | using Entities.Dtos; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq.Expressions; 7 | using System.Text; 8 | 9 | namespace Business.Abstract 10 | { 11 | public interface ICarService 12 | { 13 | IDataResult> GetAll(); 14 | IResult Add(Car car); 15 | IResult Update(Car car); 16 | IResult Delete(Car car); 17 | IDataResult GetById(int CarID); 18 | IDataResult> GetCarDetails(); 19 | IDataResult> GetCarImageDetails(int carID); 20 | IDataResult> GetCarDetailsByBrandId(int brandID); 21 | IDataResult> GetCarDetailsByColorId(int colorID); 22 | IDataResult> GetCarDetailsByColorOrBrandId(int colorID, int brandID); 23 | IDataResult GetCarDetailsById(int carID); 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Business/Abstract/IColorService.cs: -------------------------------------------------------------------------------- 1 | using Core.Utilities.Results.Abstract; 2 | using Entities.Concrete; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace Business.Abstract 8 | { 9 | public interface IColorService 10 | { 11 | IDataResult> GetAll(); 12 | IResult Add(Color color); 13 | IResult Update(Color color); 14 | IResult Delete(Color color); 15 | IDataResult GetById(int colorID); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Business/Abstract/ICreditCardService.cs: -------------------------------------------------------------------------------- 1 | using Core.Utilities.Results.Abstract; 2 | using Entities.Concrete; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace Business.Abstract 8 | { 9 | public interface ICreditCardService 10 | { 11 | IDataResult> GetAll(); 12 | IResult Add(CreditCard creditCard); 13 | IResult Update(CreditCard creditCard); 14 | IResult Delete(CreditCard creditCard); 15 | IDataResult GetById(int creditCardID); 16 | IDataResult> GetByUserId(int userID); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Business/Abstract/ICustomerService.cs: -------------------------------------------------------------------------------- 1 | using Core.Utilities.Results.Abstract; 2 | using Entities.Concrete; 3 | using Entities.Dtos; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace Business.Abstract 9 | { 10 | public interface ICustomerService 11 | { 12 | IDataResult> GetAll(); 13 | IResult Add(Customer customer); 14 | IResult Update(Customer customer); 15 | IResult Delete(Customer customer); 16 | IDataResult GetById(int customerID); 17 | IDataResult> GetCustomerDetails(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Business/Abstract/IFindexService.cs: -------------------------------------------------------------------------------- 1 | using Core.Utilities.Results.Abstract; 2 | using Entities.Concrete; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace Business.Abstract 8 | { 9 | public interface IFindexService 10 | { 11 | IDataResult> GetAll(); 12 | IResult Add(Findex findexDto); 13 | IResult Update(Findex findexDto); 14 | IResult Delete(Findex findexDto); 15 | IDataResult GetById(int findexDtoID); 16 | IDataResult GetUserFindex(); 17 | IDataResult GetCarFindex(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Business/Abstract/IPaymentService.cs: -------------------------------------------------------------------------------- 1 | using Core.Utilities.Results.Abstract; 2 | using Entities.Concrete; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace Business.Abstract 8 | { 9 | public interface IPaymentService 10 | { 11 | IDataResult> GetAll(); 12 | IResult Add(Payment payment); 13 | IResult Update(Payment payment); 14 | IResult Delete(Payment payment); 15 | IDataResult GetById(int paymnetID); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Business/Abstract/IRentalService.cs: -------------------------------------------------------------------------------- 1 | using Core.Utilities.Results.Abstract; 2 | using Entities.Concrete; 3 | using Entities.Dtos; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace Business.Abstract 9 | { 10 | public interface IRentalService 11 | { 12 | IDataResult> GetAll(); 13 | IResult Add(Rental rental); 14 | IResult Update(Rental rental); 15 | IResult Delete(Rental rental); 16 | IDataResult GetById(int rentalID); 17 | IDataResult IsForRent(int carID); 18 | IDataResult IsForRentCompany(Rental rental); 19 | IDataResult> GetAllRentalDetails(); 20 | IDataResult GetRentalDetailsByCarId(int carId); 21 | IResult IsRentedByCarId(int carID); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Business/Abstract/IUserService.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities.Concrete; 2 | using Core.Utilities.Results.Abstract; 3 | using Entities.Dtos; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace Business.Abstract 9 | { 10 | public interface IUserService 11 | { 12 | List GetClaims(User user); 13 | IDataResult> GetAll(); 14 | IResult Add(User user); 15 | IResult Update(User user); 16 | IResult Delete(User user); 17 | IDataResult GetById(int userID); 18 | IDataResult> GetUserDetails(); 19 | User GetByMail(string email); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Business/Attributes/RentValidationAttribute.cs: -------------------------------------------------------------------------------- 1 | using Business.Abstract; 2 | using Business.Concrete; 3 | using Business.Constant; 4 | using Core.Utilities.Results.Concrate; 5 | using DataAccess.Abstract; 6 | using Entities.Concrete; 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Reflection; 10 | using System.Text; 11 | 12 | namespace Business.Attributes 13 | { 14 | [AttributeUsage(AttributeTargets.Method)] 15 | public class RentalValidationAttribute : Attribute 16 | { 17 | IRentalService _rentalDal; 18 | 19 | public RentalValidationAttribute(IRentalService rentalDal) 20 | { 21 | _rentalDal = rentalDal; 22 | 23 | //MethodInfo methodInfo = typeof(IRentalService).GetMethod("Add", new[] { typeof(string) }); 24 | //methodInfo.Invoke(new,new[],{ }); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Business/Business.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Business/BusinessAspects/Autofac/SecuredOperation.cs: -------------------------------------------------------------------------------- 1 | using Core.Utilities.Interceptors; 2 | using Core.Utilities.IoC; 3 | using Microsoft.AspNetCore.Http; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | using Microsoft.Extensions.DependencyInjection; 8 | using Business.Constant; 9 | using Core.Extensions; 10 | using Castle.DynamicProxy; 11 | 12 | namespace Business.BusinessAspects.Autofac 13 | { 14 | //JWT 15 | //TODO : Burda httpaccessor ile httpden gelen role http ile kıyaslanır. 16 | public class SecuredOperation : MethodInterception 17 | { 18 | private string[] _roles; 19 | private IHttpContextAccessor _httpContextAccessor; 20 | 21 | public SecuredOperation(string roles) 22 | { 23 | _roles = roles.Split(','); 24 | _httpContextAccessor = ServiceTool.ServiceProvider.GetService(); 25 | 26 | } 27 | 28 | protected override void OnBefore(IInvocation invocation) 29 | { 30 | var roleClaims = _httpContextAccessor.HttpContext.User.ClaimRoles(); 31 | foreach (var role in _roles) 32 | { 33 | if (roleClaims.Contains(role)) 34 | { 35 | return; 36 | } 37 | } 38 | throw new Exception(Messages.AuthorizationDenied); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Business/Concrete/AuthManager.cs: -------------------------------------------------------------------------------- 1 | using Business.Abstract; 2 | using Business.Constant; 3 | using Core.Entities.Concrete; 4 | using Core.Utilities.Results.Abstract; 5 | using Core.Utilities.Results.Concrate; 6 | using Core.Utilities.Security.Hashing; 7 | using Core.Utilities.Security.Jwt; 8 | using Entities.Dtos; 9 | using System; 10 | using System.Collections.Generic; 11 | using System.Text; 12 | 13 | namespace Business.Concrete 14 | { 15 | public class AuthManager : IAuthService 16 | { 17 | private IUserService _userService; 18 | private ITokenHelper _tokenHelper; 19 | 20 | public AuthManager(IUserService userService, ITokenHelper tokenHelper) 21 | { 22 | _userService = userService; 23 | _tokenHelper = tokenHelper; 24 | } 25 | 26 | public IDataResult Register(UserForRegisterDto userForRegisterDto, string password) 27 | { 28 | byte[] passwordHash, passwordSalt; 29 | HashingHelper.CreatePasswordHash(password, out passwordHash, out passwordSalt); 30 | var user = new User 31 | { 32 | Email = userForRegisterDto.Email, 33 | FirstName = userForRegisterDto.FirstName, 34 | LastName = userForRegisterDto.LastName, 35 | NickName = userForRegisterDto.NickName, 36 | PasswordHash = passwordHash, 37 | PasswordSalt = passwordSalt, 38 | Status = true 39 | }; 40 | _userService.Add(user); 41 | return new SuccessDataResult(user, Messages.UserRegistered); 42 | } 43 | 44 | public IDataResult Login(UserForLoginDto userForLoginDto) 45 | { 46 | var userToCheck = _userService.GetByMail(userForLoginDto.Email); 47 | if (userToCheck == null) 48 | { 49 | return new ErrorDataResult(Messages.UserNotFound); 50 | } 51 | 52 | if (!HashingHelper.VerifyPasswordHash(userForLoginDto.Password, userToCheck.PasswordHash, userToCheck.PasswordSalt)) 53 | { 54 | return new ErrorDataResult(Messages.PasswordError); 55 | } 56 | 57 | return new SuccessDataResult(userToCheck, Messages.SuccessfulLogin); 58 | } 59 | 60 | public IResult UserExists(string email) 61 | { 62 | if (_userService.GetByMail(email) != null) 63 | { 64 | return new ErrorResult(Messages.UserAlreadyExists); 65 | } 66 | return new SuccessResult(); 67 | } 68 | 69 | public IDataResult CreateAccessToken(User user) 70 | { 71 | var claims = _userService.GetClaims(user); 72 | var accessToken = _tokenHelper.CreateToken(user, claims); 73 | return new SuccessDataResult(accessToken, Messages.AccessTokenCreated); 74 | } 75 | 76 | public IDataResult ValidateToken(string authToken) 77 | { 78 | //var tokenHandler = new JwtSecurityTokenHandler(); 79 | //var validationParameters = GetValidationParameters(); 80 | 81 | //SecurityToken validatedToken; 82 | //IPrincipal principal = tokenHandler.ValidateToken(authToken, validationParameters, out validatedToken); 83 | //Thread.CurrentPrincipal = principal; 84 | //return true; 85 | return null; 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /Business/Concrete/BrandManager.cs: -------------------------------------------------------------------------------- 1 | using Business.Abstract; 2 | using Business.BusinessAspects.Autofac; 3 | using Business.Constant; 4 | using Business.ValidationRules.FluentValidation; 5 | using Core.Aspects.Autofac.Validation; 6 | using Core.Utilities.Results.Abstract; 7 | using Core.Utilities.Results.Concrate; 8 | using DataAccess.Abstract; 9 | using Entities.Concrete; 10 | using System; 11 | using System.Collections.Generic; 12 | using System.Text; 13 | 14 | namespace Business.Concrete 15 | { 16 | public class BrandManager : IBrandService 17 | { 18 | IBrandDal _brandDal; 19 | 20 | public BrandManager(IBrandDal rentalDal) 21 | { 22 | _brandDal = rentalDal; 23 | } 24 | 25 | [ValidationAspect(typeof(BrandValidator))] 26 | [SecuredOperation("admin")] 27 | public IResult Add(Brand brand) 28 | { 29 | _brandDal.Add(brand); 30 | return new SuccessResult(Messages.BrandAdded); 31 | } 32 | 33 | public IResult Delete(Brand brand) 34 | { 35 | _brandDal.Delete(brand); 36 | return new SuccessResult(Messages.BrandDeleted); 37 | } 38 | 39 | public IDataResult> GetAll() 40 | { 41 | return new SuccessDataResult>(_brandDal.GetAll()); 42 | } 43 | 44 | public IDataResult GetById(int brandID) 45 | { 46 | return new SuccessDataResult(_brandDal.Get(p => p.ID == brandID)); 47 | } 48 | 49 | public IResult Update(Brand brand) 50 | { 51 | _brandDal.Update(brand); 52 | return new SuccessResult(Messages.BrandUpdated); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Business/Concrete/CarManager.cs: -------------------------------------------------------------------------------- 1 | using Business.Abstract; 2 | using Business.BusinessAspects.Autofac; 3 | using Business.Constant; 4 | using Business.ValidationRules; 5 | using Core.Utilities.Results.Abstract; 6 | using Core.Utilities.Results.Concrate; 7 | using DataAccess.Abstract; 8 | using Entities.Concrete; 9 | using Entities.Dtos; 10 | using FluentValidation; 11 | using System; 12 | using System.Collections.Generic; 13 | using System.Linq.Expressions; 14 | using System.Text; 15 | 16 | namespace Business.Concrete 17 | { 18 | public class CarManager : ICarService 19 | { 20 | private delegate void DelegateValidator(); 21 | ICarDal _carDal; 22 | public CarManager(ICarDal carDal) 23 | { 24 | _carDal = carDal; 25 | } 26 | [SecuredOperation("admin")] 27 | public IResult Add(Car car) 28 | { 29 | _carDal.Add(car); 30 | return new SuccessResult(Messages.CarAdded); 31 | } 32 | 33 | public IResult Delete(Car car) 34 | { 35 | _carDal.Delete(car); 36 | return new SuccessResult(Messages.CarDeleted); 37 | } 38 | 39 | public IDataResult> GetAll() 40 | { 41 | return new SuccessDataResult>(_carDal.GetAll()); 42 | } 43 | 44 | public IDataResult GetById(int carID) 45 | { 46 | return new SuccessDataResult(_carDal.Get(p => p.ID == carID)); 47 | } 48 | 49 | public IResult Update(Car car) 50 | { 51 | _carDal.Update(car); 52 | return new SuccessResult(Messages.CarAdded); 53 | } 54 | 55 | public IDataResult> GetCarDetails() 56 | { 57 | return new SuccessDataResult>(_carDal.GetCarDetails()); 58 | } 59 | 60 | public IDataResult> GetCarDetailsByBrandId(int brandID) 61 | { 62 | return new SuccessDataResult>(_carDal.GetCarDetails(p => p.BrandID == brandID)); 63 | } 64 | public IDataResult> GetCarDetailsByColorId(int colorId) 65 | { 66 | return new SuccessDataResult>(_carDal.GetCarDetails(p => p.ColorID == colorId)); 67 | } 68 | public IDataResult> GetCarImageDetails(int carID) 69 | { 70 | return new SuccessDataResult>(_carDal.GetCarImageDetails(p => p.CarID == carID)); 71 | } 72 | 73 | public IDataResult> GetCarDetailsByColorOrBrandId(int colorID, int brandID) 74 | { 75 | return new SuccessDataResult>(_carDal.GetCarDetails(p => p.ColorID == colorID || p.BrandID == brandID)); 76 | } 77 | 78 | public IDataResult GetCarDetailsById(int carID) 79 | { 80 | return new SuccessDataResult(_carDal.GetCarDetails(p => p.ID == carID)[0]); 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /Business/Concrete/ColorManager.cs: -------------------------------------------------------------------------------- 1 | using Business.Abstract; 2 | using Business.BusinessAspects.Autofac; 3 | using Business.Constant; 4 | using Business.ValidationRules.FluentValidation; 5 | using Core.Aspects.Autofac.Validation; 6 | using Core.Utilities.Results.Abstract; 7 | using Core.Utilities.Results.Concrate; 8 | using DataAccess.Abstract; 9 | using Entities.Concrete; 10 | using System; 11 | using System.Collections.Generic; 12 | using System.Text; 13 | 14 | namespace Business.Concrete 15 | { 16 | public class ColorManager : IColorService 17 | { 18 | IColorDal _colorDal; 19 | public ColorManager(IColorDal colorDal) 20 | { 21 | _colorDal = colorDal; 22 | } 23 | [SecuredOperation("admin")] 24 | [ValidationAspect(typeof(ColorValidator))] 25 | public IResult Add(Color color) 26 | { 27 | _colorDal.Add(color); 28 | return new SuccessResult(Messages.ColorAdded); 29 | } 30 | 31 | public IResult Delete(Color color) 32 | { 33 | _colorDal.Delete(color); 34 | return new SuccessResult(Messages.ColorDeleted); 35 | } 36 | [ValidationAspect(typeof(ColorValidator))] 37 | public IDataResult> GetAll() 38 | { 39 | return new SuccessDataResult>(_colorDal.GetAll()); 40 | } 41 | 42 | public IDataResult GetById(int colorID) 43 | { 44 | return new SuccessDataResult(_colorDal.Get(p => p.ID == colorID)); 45 | } 46 | 47 | public IResult Update(Color color) 48 | { 49 | _colorDal.Update(color); 50 | return new SuccessResult(Messages.ColorUpdated); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Business/Concrete/CreditCardManager.cs: -------------------------------------------------------------------------------- 1 | using Business.Abstract; 2 | using Business.Constant; 3 | using Core.Utilities.Results.Abstract; 4 | using Core.Utilities.Results.Concrate; 5 | using DataAccess.Abstract; 6 | using Entities.Concrete; 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Text; 10 | 11 | namespace Business.Concrete 12 | { 13 | public class CreditCardManager : ICreditCardService 14 | { 15 | ICreditCardDal _creditCardDal; 16 | 17 | public CreditCardManager(ICreditCardDal creditCardDal) 18 | { 19 | _creditCardDal = creditCardDal; 20 | } 21 | 22 | public IResult Add(CreditCard creditCard) 23 | { 24 | _creditCardDal.Add(creditCard); 25 | return new SuccessResult(Messages.CreditCardAdded); 26 | } 27 | 28 | public IResult Delete(CreditCard creditCard) 29 | { 30 | _creditCardDal.Delete(creditCard); 31 | return new SuccessResult(Messages.CreditCardDelete); 32 | } 33 | 34 | public IDataResult> GetAll() 35 | { 36 | return new SuccessDataResult>(_creditCardDal.GetAll()); 37 | } 38 | 39 | public IDataResult GetById(int creditCardID) 40 | { 41 | return new SuccessDataResult(_creditCardDal.Get(p => p.Id == creditCardID)); 42 | } 43 | public IDataResult> GetByUserId(int userID) 44 | { 45 | return new SuccessDataResult>(_creditCardDal.GetAll(p => p.UserId == userID)); 46 | } 47 | public IResult Update(CreditCard creditCard) 48 | { 49 | _creditCardDal.Update(creditCard); 50 | return new SuccessResult(Messages.CreditCardUpdated); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Business/Concrete/CustomerManager.cs: -------------------------------------------------------------------------------- 1 | using Business.Abstract; 2 | using Business.Constant; 3 | using Core.Utilities.Results.Abstract; 4 | using Core.Utilities.Results.Concrate; 5 | using DataAccess.Abstract; 6 | using Entities.Concrete; 7 | using Entities.Dtos; 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Text; 11 | 12 | namespace Business.Concrete 13 | { 14 | public class CustomerManager : ICustomerService 15 | { 16 | ICustomerDal _customerDal; 17 | public CustomerManager(ICustomerDal customerDal) 18 | { 19 | _customerDal = customerDal; 20 | } 21 | public IResult Add(Customer customer) 22 | { 23 | _customerDal.Add(customer); 24 | return new SuccessResult(Messages.CustomerAdded); 25 | } 26 | 27 | public IResult Delete(Customer customer) 28 | { 29 | _customerDal.Delete(customer); 30 | return new SuccessResult(Messages.CustomerDeleted); 31 | } 32 | 33 | public IDataResult> GetAll() 34 | { 35 | return new SuccessDataResult>(_customerDal.GetAll()); 36 | } 37 | 38 | public IDataResult GetById(int customerID) 39 | { 40 | return new SuccessDataResult(_customerDal.Get(p => p.ID == customerID)); 41 | } 42 | 43 | public IDataResult> GetCustomerDetails() 44 | { 45 | return new SuccessDataResult>(_customerDal.GetCustomerDetails()); 46 | } 47 | 48 | public IResult Update(Customer customer) 49 | { 50 | _customerDal.Update(customer); 51 | return new SuccessResult(Messages.CustomerUpdated); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Business/Concrete/FindexManager.cs: -------------------------------------------------------------------------------- 1 | using Business.Abstract; 2 | using Core.Utilities.Results.Abstract; 3 | using Core.Utilities.Results.Concrate; 4 | using Entities.Concrete; 5 | using Entities.Dtos; 6 | using System; 7 | using System.Collections.Generic; 8 | using System.Text; 9 | 10 | namespace Business.Concrete 11 | { 12 | public class FindexManager : IFindexService 13 | { 14 | public IResult Add(Findex findex) 15 | { 16 | Console.WriteLine("Added"); 17 | return new SuccessResult(); 18 | } 19 | 20 | public IResult Delete(Findex findex) 21 | { 22 | Console.WriteLine("Deleted"); 23 | return new SuccessResult(); 24 | } 25 | 26 | public IDataResult> GetAll() 27 | { 28 | return new SuccessDataResult>(); 29 | } 30 | 31 | public IDataResult GetById(int findexDtoID) 32 | { 33 | return new SuccessDataResult(); 34 | } 35 | 36 | public IDataResult GetCarFindex() 37 | { 38 | Random random = new Random(); 39 | int result = random.Next(0, 1900); 40 | return new SuccessDataResult(result); 41 | } 42 | 43 | public IDataResult GetUserFindex() 44 | { 45 | Random random = new Random(); 46 | int result = random.Next(0, 1900); 47 | return new SuccessDataResult(result); 48 | } 49 | 50 | public IResult Update(Findex findex) 51 | { 52 | Console.WriteLine("Update"); 53 | return new SuccessResult(); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Business/Concrete/PaymentManager.cs: -------------------------------------------------------------------------------- 1 | using Business.Abstract; 2 | using Core.Utilities.Results.Abstract; 3 | using Core.Utilities.Results.Concrate; 4 | using Entities.Concrete; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Text; 8 | 9 | namespace Business.Concrete 10 | { 11 | public class PaymentManager : IPaymentService 12 | { 13 | public IResult Add(Payment payment) 14 | { 15 | Console.WriteLine("Added"); 16 | return new SuccessResult(); 17 | } 18 | 19 | public IResult Delete(Payment payment) 20 | { 21 | Console.WriteLine("Deleted"); 22 | return new SuccessResult(); 23 | } 24 | 25 | public IDataResult> GetAll() 26 | { 27 | throw new NotImplementedException(); 28 | } 29 | 30 | public IDataResult GetById(int paymnetID) 31 | { 32 | throw new NotImplementedException(); 33 | } 34 | 35 | public IResult Update(Payment payment) 36 | { 37 | Console.WriteLine("Updated"); 38 | return new SuccessResult(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Business/Concrete/UserManager.cs: -------------------------------------------------------------------------------- 1 | using Business.Abstract; 2 | using Business.Constant; 3 | using Business.ValidationRules; 4 | using Core.Entities.Concrete; 5 | using Core.Utilities.Results.Abstract; 6 | using Core.Utilities.Results.Concrate; 7 | using DataAccess.Abstract; 8 | using Entities.Concrete; 9 | using Entities.Dtos; 10 | using System; 11 | using System.Collections.Generic; 12 | using System.Text; 13 | 14 | namespace Business.Concrete 15 | { 16 | public class UserManager : IUserService 17 | { 18 | IUserDal _userDal; 19 | 20 | public UserManager(IUserDal userDal) 21 | { 22 | _userDal = userDal; 23 | } 24 | 25 | 26 | public IResult Add(User user) 27 | { 28 | _userDal.Add(user); 29 | return new SuccessResult(Messages.UserAdded); 30 | } 31 | 32 | public IResult Delete(User user) 33 | { 34 | _userDal.Delete(user); 35 | return new SuccessResult(Messages.UserDeleted); 36 | } 37 | 38 | public IDataResult> GetAll() 39 | { 40 | return new SuccessDataResult>(_userDal.GetAll()); 41 | } 42 | 43 | public IDataResult GetById(int userID) 44 | { 45 | return new SuccessDataResult(_userDal.Get(p => p.ID == userID)); 46 | } 47 | 48 | public IDataResult> GetUserDetails() 49 | { 50 | return new SuccessDataResult>(_userDal.GetCustomerDetails()); 51 | } 52 | 53 | public IResult Update(User user) 54 | { 55 | _userDal.Update(user); 56 | return new SuccessResult(Messages.UserUpdate); 57 | } 58 | public User GetByMail(string email) 59 | { 60 | return _userDal.Get(u => u.Email == email); 61 | } 62 | public List GetClaims(User user) 63 | { 64 | return _userDal.GetClaims(user); 65 | } 66 | 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Business/Constant/FilePath.cs: -------------------------------------------------------------------------------- 1 | using Storage; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Business.Constant 7 | { 8 | public static class FilePath 9 | { 10 | public static string _carImagePathNoName = StorageFilePath.GetPathCarImages(); 11 | public static string _carImageNameDefault = "RentACarImageDefault.jpg"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Business/Constant/Messages.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Business.Constant 6 | { 7 | public static class Messages 8 | { 9 | #region CarReg 10 | /**Car Alanı**/ 11 | public static string CarAdded = "Car added"; 12 | public static string CarAddedInvalid = "Car added invalided"; 13 | public static string CarDeleted = "Car deleted"; 14 | //public static string CarDeletedInvalid = "Car deleted invalided"; 15 | public static string CarUpdated = "Car updated"; 16 | //public static string CarUpdatedInvalid = "Car updated invalided"; 17 | #endregion 18 | #region UserReg 19 | /**User Alanı**/ 20 | public static string UserAdded = "User added"; 21 | //public static string UserAddedInvalid = "User added invalided"; 22 | public static string UserDeleted = "User deleted"; 23 | //public static string UserDeletedInvalid = "User deleted invalided"; 24 | public static string UserUpdate = "User updated"; 25 | //public static string UserDeletedInvalid = "User updated invalided"; 26 | #endregion 27 | #region RentalReg 28 | /**Rental Alanı**/ 29 | public static string RentalAdd = "Rental added"; 30 | public static string RentalAddInvalid = "Rental added invalided"; 31 | public static string RentalDeletedInvalid = "Rental added invalided"; 32 | public static string RentalDelete = "Rental deleted"; 33 | //public static string RentalDeletedInvalid = "Rental deleted invalided"; 34 | public static string RentalUpdate = "Rental updated"; 35 | public static string RentalUpdatedInvalid = "Rental updated invalided"; 36 | public static string IsForRent = "This car can be rented"; 37 | public static string IsForRentInvalid = "This car can not be rented"; 38 | #endregion 39 | #region BrandReg 40 | public static string BrandAdded = "Brand added"; 41 | public static string BrandDeleted = "Brand deleted"; 42 | public static string BrandUpdated = "Brand updated"; 43 | #endregion 44 | #region ColorReg 45 | public static string ColorAdded = "Color added"; 46 | public static string ColorDeleted = "Color deleted"; 47 | public static string ColorUpdated = "Color updated"; 48 | #endregion 49 | #region CarImage 50 | public static string CarImageAdded = "CarImage added"; 51 | public static string CarImageDeleted = "CarImage deleted"; 52 | public static string CarImageUpdated = "CarImage updated"; 53 | public static string CarImageLimitExceded = "5 ten fazla araba resminiz olamaz"; 54 | public static string CarImageDateExceded = "Zamanlar eşleşmiyor."; 55 | public static string CarImagesDeleteExceded = "Resminiz silinmedi"; 56 | public static string CarImagesUpdateExceded = "Resminiz güncellenemedi"; 57 | #endregion 58 | #region AuthReg 59 | public static string AuthorizationDenied = "You have no authorization"; 60 | public static string UserRegistered = "Registration Successful"; 61 | public static string UserNotFound = "No user"; 62 | public static string PasswordError = "Password is incorrect"; 63 | public static string SuccessfulLogin = "Login successful"; 64 | public static string UserAlreadyExists = "User registered"; 65 | public static string AccessTokenCreated = "Accestoken oluşturuldu"; 66 | #endregion 67 | #region CustomerReg 68 | public static string CustomerAdded = "Customer Added"; 69 | public static string CustomerDeleted = "Customer Deleted"; 70 | public static string CustomerUpdated = "Customer Updated"; 71 | #endregion 72 | #region CreditCardReg 73 | public static string CreditCardAdded="Credit Card Added"; 74 | public static string CreditCardDelete= "Credit Card Deleted"; 75 | public static string CreditCardUpdated= "Credit Card Updated"; 76 | #endregion 77 | } 78 | } -------------------------------------------------------------------------------- /Business/DependencyResolvers/AutoFac/AutofacBusinessModule.cs: -------------------------------------------------------------------------------- 1 | using Autofac; 2 | using Autofac.Extras.DynamicProxy; 3 | using Business.Abstract; 4 | using Business.Concrete; 5 | using Castle.DynamicProxy; 6 | using Core.Utilities.Interceptors; 7 | using Core.Utilities.Security.Jwt; 8 | using DataAccess.Abstract; 9 | using DataAccess.Concrete.EntityFramework; 10 | using System; 11 | using System.Collections.Generic; 12 | using System.Text; 13 | 14 | namespace Business.DependencyResolvers.AutoFac 15 | { 16 | public class AutofacBusinessModule : Module 17 | { 18 | protected override void Load(ContainerBuilder builder) 19 | { 20 | builder.RegisterType().As().SingleInstance(); 21 | builder.RegisterType().As().SingleInstance(); 22 | 23 | builder.RegisterType().As().SingleInstance(); 24 | builder.RegisterType().As().SingleInstance(); 25 | 26 | builder.RegisterType().As().SingleInstance(); 27 | builder.RegisterType().As().SingleInstance(); 28 | 29 | builder.RegisterType().As().SingleInstance(); 30 | builder.RegisterType().As().SingleInstance(); 31 | 32 | builder.RegisterType().As().SingleInstance(); 33 | builder.RegisterType().As().SingleInstance(); 34 | 35 | builder.RegisterType().As().SingleInstance(); 36 | builder.RegisterType().As().SingleInstance(); 37 | 38 | builder.RegisterType().As().SingleInstance(); 39 | builder.RegisterType().As().SingleInstance(); 40 | 41 | builder.RegisterType().As().SingleInstance(); 42 | builder.RegisterType().As().SingleInstance(); 43 | 44 | builder.RegisterType().As().SingleInstance(); 45 | 46 | builder.RegisterType().As(); 47 | builder.RegisterType().As(); 48 | 49 | var assembly = System.Reflection.Assembly.GetExecutingAssembly(); 50 | 51 | builder.RegisterAssemblyTypes(assembly).AsImplementedInterfaces() 52 | .EnableInterfaceInterceptors(new ProxyGenerationOptions() 53 | { 54 | Selector = new AspectInterceptorSelector() 55 | }).SingleInstance(); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Business/DependencyResolvers/Ninject/BusinessModule.cs: -------------------------------------------------------------------------------- 1 | using Business.Abstract; 2 | using Business.Concrete; 3 | using DataAccess.Abstract; 4 | using Ninject.Modules; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Text; 8 | 9 | namespace Business.DependencyResolvers.Ninject 10 | { 11 | //public class BusinessModule : NinjectModule 12 | //{ 13 | // public override void Load() 14 | // { 15 | // Bind().To(); 16 | // Bind().To(); 17 | 18 | // Bind().To(); 19 | // Bind().To(); 20 | 21 | // Bind().To(); 22 | // Bind().To(); 23 | // } 24 | //} 25 | } 26 | -------------------------------------------------------------------------------- /Business/DependencyResolvers/Ninject/InstanceFactory.cs: -------------------------------------------------------------------------------- 1 | using Ninject; 2 | using Ninject.Modules; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace Business.DependencyResolvers.Ninject 8 | { 9 | //public static class InstanceFactory 10 | //{ 11 | // public static T GetInstance(INinjectModule module) 12 | // { 13 | // var kernel = new StandardKernel(module); 14 | // return kernel.Get(); 15 | // } 16 | //} 17 | } 18 | -------------------------------------------------------------------------------- /Business/HandleException/HandleException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Business.HandleException 6 | { 7 | public class HandleException : IException 8 | { 9 | public static string HandleExMessage { get; set; } 10 | public static string Error(Action action) 11 | { 12 | try 13 | { 14 | action.Invoke(); 15 | } 16 | catch (Exception ex) 17 | { 18 | HandleExMessage = ex.Message.ToString(); 19 | } 20 | finally 21 | { 22 | 23 | } 24 | return HandleExMessage; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Business/HandleException/IException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Business.HandleException 6 | { 7 | public interface IException 8 | { 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Business/ValidationRules/FluentValidation/BrandValidator.cs: -------------------------------------------------------------------------------- 1 | using Entities.Concrete; 2 | using FluentValidation; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace Business.ValidationRules.FluentValidation 8 | { 9 | public class BrandValidator:AbstractValidator 10 | { 11 | public BrandValidator() 12 | { 13 | 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Business/ValidationRules/FluentValidation/CarValidator.cs: -------------------------------------------------------------------------------- 1 | using Entities.Concrete; 2 | using FluentValidation; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace Business.ValidationRules 8 | { 9 | public class CarValidator : AbstractValidator 10 | { 11 | public CarValidator() 12 | { 13 | RuleFor(p => p.BrandID).NotEmpty(); 14 | RuleFor(p => p.ColorID).NotEmpty(); 15 | RuleFor(t => t.DailyPrice).GreaterThan(0).WithMessage("0'dan büyük olmalı=> DailPrice"); 16 | RuleFor(t => t.Description).Must(DescriptionLengthWithTwo).WithMessage("Açıklama 2 karakterden büyük olmalıdır.=>Description"); 17 | RuleFor(t => t.Description).Must(DescriptionWithA).WithMessage("Açıklama A karakterden başlamalıdır.=>Description"); 18 | } 19 | 20 | private bool DescriptionWithA(string arg) 21 | { 22 | return arg.StartsWith('a'); 23 | } 24 | 25 | private bool DescriptionLengthWithTwo(string arg) 26 | { 27 | return arg.Length > 2; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Business/ValidationRules/FluentValidation/ColorValidator.cs: -------------------------------------------------------------------------------- 1 | using Entities.Concrete; 2 | using FluentValidation; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace Business.ValidationRules.FluentValidation 8 | { 9 | public class ColorValidator:AbstractValidator 10 | { 11 | public ColorValidator() 12 | { 13 | 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Business/ValidationRules/FluentValidation/RentalValidator.cs: -------------------------------------------------------------------------------- 1 | using Entities.Concrete; 2 | using FluentValidation; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace Business.ValidationRules 8 | { 9 | public class RentalValidator : AbstractValidator 10 | { 11 | public RentalValidator() 12 | { 13 | RuleFor(p => p.CarID).GreaterThan(0); 14 | RuleFor(p => p.CustomerID).GreaterThan(0); 15 | RuleFor(p => p.CarID).NotEmpty(); 16 | RuleFor(p => p.CustomerID).NotEmpty(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Business/ValidationRules/FluentValidation/UserValidator.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities.Concrete; 2 | using Entities.Concrete; 3 | using FluentValidation; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace Business.ValidationRules 9 | { 10 | public class UserValidator : AbstractValidator 11 | { 12 | public UserValidator() 13 | { 14 | RuleFor(t => t.FirstName).NotNull().WithMessage("boş olmamalı => FirstName"); 15 | RuleFor(t => t.FirstName).Must(FirstNameLengthWithTwo).WithMessage("İlk adın 2 karakterden büyük olmalıdır.=>FirstName"); 16 | RuleFor(t => t.LastName).Must(LastNameLengthWithTwo).WithMessage("İlk adın 2 karakterden büyük olmalıdır.=>LastName"); 17 | RuleFor(t => t.NickName).Must(NickNameLengthWithTwo).WithMessage("İlk adın 2 karakterden büyük olmalıdır.=>NickName"); 18 | RuleFor(t => t.Email).Must(IsEmail).WithMessage("Geçersiz =>Email"); 19 | } 20 | 21 | private bool IsEmail(string arg) 22 | { 23 | bool key=false; 24 | if (arg.IndexOf("@") > -1) 25 | { 26 | key= true; 27 | } 28 | else if (arg.IndexOf("@") <= -1) 29 | { 30 | key= false; 31 | } 32 | return key; 33 | } 34 | 35 | private bool NickNameLengthWithTwo(string arg) 36 | { 37 | return arg.Length > 2; 38 | } 39 | 40 | private bool LastNameLengthWithTwo(string arg) 41 | { 42 | return arg.Length > 2; 43 | } 44 | 45 | private bool FirstNameLengthWithTwo(string arg) 46 | { 47 | return arg.Length > 2; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /ConsoleUI/ConsoleUI.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | Enes Özmert taarafından geliştirildi. 7 | Power by efyaz.com 8 | efyaz 9 | efyaz.com 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /ConsoleUI/IConsoleUI.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace ConsoleUI 6 | { 7 | public interface IConsoleUI 8 | { 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /ConsoleUI/Program.cs: -------------------------------------------------------------------------------- 1 | using Business.Abstract; 2 | using Business.Concrete; 3 | using Business.HandleException; 4 | using DataAccess.Concrate; 5 | using DataAccess.Concrete.EntityFramework; 6 | using Entities.Concrete; 7 | using System; 8 | 9 | namespace ConsoleUI 10 | { 11 | class Program 12 | { 13 | private static ICarService _carService; 14 | private static IUserService _userService; 15 | private static IRentalService _rentalService; 16 | static void Main(string[] args) 17 | { 18 | 19 | string iDate = "2022-02-02"; 20 | DateTime oDate = DateTime.Parse(iDate); 21 | var carImagePathNoName = AppDomain.CurrentDomain.BaseDirectory; 22 | //Car car1 = new Car() { BrandID = 3, ColorID = 2, DailyPrice = 2, Description = "arenault", ModelYear = 2002 }; 23 | //Car car2 = new Car() { BrandID = 1, ColorID =2 , DailyPrice = 111, Description = "yenieklendi", ModelYear = 1992 }; 24 | //User user1 = new User { Email = "enes1@enes2.com", FirstName = "enes2", LastName = "abc1", NickName = "enes2abc1", Password = "abc1" }; 25 | //Rental rental = new Rental { CarID = 11, CustomerID = 1, RentDate = DateTime.Now.Date, ReturnDate = null, IsEnabled = false }; 26 | ////Dependency injection // Ioc Container=>Ninject 27 | //_carService = InstanceFactory.GetInstance(new BusinessModule()); 28 | //_userService = InstanceFactory.GetInstance(new BusinessModule()); 29 | //_rentalService = InstanceFactory.GetInstance(new BusinessModule()); 30 | //CarAdded(car1, _carService); 31 | //_userService.Add(user1); 32 | //_rentalService.Add(rental); 33 | //var result = _rentalService.Add(rental); 34 | //if (result.Success) 35 | //{ 36 | // HandleException.Error(() => { _rentalService.Add(rental); }); 37 | //} 38 | //Console.WriteLine(result.Message); 39 | //HandleException.Error(() => { Console.WriteLine(result.Message); }); 40 | //IsForRent(); 41 | //Console.WriteLine(_rentalService.IsForRent(2017).Message); 42 | //CarDeatails(_carService); 43 | 44 | } 45 | 46 | private static void IsForRent() 47 | { 48 | var result = _rentalService.IsForRent(20); 49 | if (result.Success == true) 50 | { 51 | _rentalService.IsForRent(20); 52 | Console.WriteLine(_rentalService.IsForRent(20).Message); 53 | Console.WriteLine(_rentalService.IsForRent(20).Data.ID); 54 | } 55 | else 56 | { 57 | Console.WriteLine(_rentalService.IsForRent(20).Message); 58 | } 59 | } 60 | 61 | private static void CarDeatails(ICarService carService) 62 | { 63 | var result = carService.GetCarDetails(); 64 | if (result.Success == true) 65 | { 66 | //carManager.Add(car1); 67 | foreach (var item in carService.GetCarDetails().Data) 68 | { 69 | Console.WriteLine(item.ID + "/" + item.DailyPrice + "/" + "=>" + item.ColorName + "/" + item.BrandName); 70 | } 71 | } 72 | else 73 | { 74 | Console.WriteLine(result.Message); 75 | } 76 | } 77 | 78 | private static void CarAdded(Car car1, ICarService carService) 79 | { 80 | try 81 | { 82 | //carManager.Add(car1); 83 | Console.WriteLine(carService.Add(car1).Message); 84 | } 85 | catch (Exception ex) 86 | { 87 | 88 | Console.WriteLine(ex.Message.ToString()); 89 | } 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /ConsoleUI/RentaCar.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace ConsoleUI 6 | { 7 | public class RentaCar:IConsoleUI 8 | { 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Core/Aspects/Autofac/Caching/CacheAspect.cs: -------------------------------------------------------------------------------- 1 | using Castle.DynamicProxy; 2 | using Core.CrossCuttingConcerns.Caching; 3 | using Core.Utilities.Interceptors; 4 | using Core.Utilities.IoC; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Text; 9 | using Microsoft.Extensions.DependencyInjection; 10 | 11 | namespace Core.Aspects.Autofac.Caching 12 | { 13 | public class CacheAspect : MethodInterception 14 | { 15 | private int _duration; 16 | private ICacheManager _cacheManager; 17 | 18 | public CacheAspect(int duration = 60) 19 | { 20 | _duration = duration; 21 | _cacheManager = ServiceTool.ServiceProvider.GetService(); 22 | } 23 | 24 | public override void Intercept(IInvocation invocation) 25 | { 26 | var methodName = string.Format($"{invocation.Method.ReflectedType.FullName}.{invocation.Method.Name}"); 27 | var arguments = invocation.Arguments.ToList(); 28 | var key = $"{methodName}({string.Join(",", arguments.Select(x => x?.ToString() ?? ""))})"; 29 | if (_cacheManager.IsAdd(key)) 30 | { 31 | invocation.ReturnValue = _cacheManager.Get(key); 32 | return; 33 | } 34 | invocation.Proceed(); 35 | _cacheManager.Add(key, invocation.ReturnValue, _duration); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Core/Aspects/Autofac/Caching/CacheRemoveAspect.cs: -------------------------------------------------------------------------------- 1 | using Core.CrossCuttingConcerns.Caching; 2 | using Core.Utilities.Interceptors; 3 | using Core.Utilities.IoC; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | using Microsoft.Extensions.DependencyInjection; 8 | using Castle.DynamicProxy; 9 | 10 | namespace Core.Aspects.Autofac.Caching 11 | { 12 | public class CacheRemoveAspect : MethodInterception 13 | { 14 | private string _pattern; 15 | private ICacheManager _cacheManager; 16 | 17 | public CacheRemoveAspect(string pattern) 18 | { 19 | _pattern = pattern; 20 | _cacheManager = ServiceTool.ServiceProvider.GetService(); 21 | } 22 | 23 | protected override void OnSuccess(IInvocation invocation) 24 | { 25 | _cacheManager.RemoveByPattern(_pattern); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Core/Aspects/Autofac/CancellationToken/CancellationTokenAspect.cs: -------------------------------------------------------------------------------- 1 | using Castle.DynamicProxy; 2 | using Core.Utilities.Interceptors; 3 | using Core.Utilities.IoC; 4 | using Microsoft.AspNetCore.Http; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Text; 8 | using Microsoft.Extensions.DependencyInjection; 9 | using System.Threading.Tasks; 10 | 11 | namespace Core.Aspects.Autofac.CancellationToken 12 | { 13 | public class CancellationTokenAspect : MethodInterception 14 | { 15 | public override void Intercept(IInvocation invocation) 16 | { 17 | var token = ServiceTool.ServiceProvider.GetService().HttpContext.RequestAborted; 18 | Task.Run(() => { invocation.Proceed(); }, token).Wait(token); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Core/Aspects/Autofac/Performance/PerformanceAspect.cs: -------------------------------------------------------------------------------- 1 | using Castle.DynamicProxy; 2 | using Core.Utilities.Interceptors; 3 | using Core.Utilities.IoC; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Diagnostics; 7 | using System.Text; 8 | using Microsoft.Extensions.DependencyInjection; 9 | 10 | namespace Core.Aspects.Autofac.Performance 11 | { 12 | public class PerformanceAspect : MethodInterception 13 | { 14 | private int _interval; 15 | private Stopwatch _stopwatch; 16 | 17 | public PerformanceAspect(int interval) 18 | { 19 | _interval = interval; 20 | _stopwatch = ServiceTool.ServiceProvider.GetService(); 21 | } 22 | 23 | 24 | protected override void OnBefore(IInvocation invocation) 25 | { 26 | _stopwatch.Start(); 27 | } 28 | 29 | protected override void OnAfter(IInvocation invocation) 30 | { 31 | if (_stopwatch.Elapsed.TotalSeconds > _interval) 32 | { 33 | Debug.WriteLine($"Performance : {invocation.Method.DeclaringType.FullName}.{invocation.Method.Name}-->{_stopwatch.Elapsed.TotalSeconds}"); 34 | } 35 | _stopwatch.Reset(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Core/Aspects/Autofac/Transaction/TransactionScopeAspect.cs: -------------------------------------------------------------------------------- 1 | using Castle.DynamicProxy; 2 | using Core.Utilities.Interceptors; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | using System.Transactions; 7 | 8 | namespace Core.Aspects.Autofac.Transaction 9 | { 10 | public class TransactionScopeAspect : MethodInterception 11 | { 12 | public override void Intercept(IInvocation invocation) 13 | { 14 | using (TransactionScope transactionScope = new TransactionScope()) 15 | { 16 | try 17 | { 18 | invocation.Proceed(); 19 | transactionScope.Complete(); 20 | } 21 | catch (System.Exception e) 22 | { 23 | transactionScope.Dispose(); 24 | throw; 25 | } 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Core/Aspects/Autofac/Validation/ValidationAspect.cs: -------------------------------------------------------------------------------- 1 | using Business.ValidationRules; 2 | using Castle.DynamicProxy; 3 | using Core.Utilities.Interceptors; 4 | using FluentValidation; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Text; 9 | 10 | namespace Core.Aspects.Autofac.Validation 11 | { 12 | public class ValidationAspect : MethodInterception 13 | { 14 | private Type _validatorType; 15 | public ValidationAspect(Type validatorType) 16 | { 17 | if (!typeof(IValidator).IsAssignableFrom(validatorType)) 18 | { 19 | throw new System.Exception("Bu bir doğrulama kodu değildir."); 20 | } 21 | 22 | _validatorType = validatorType; 23 | } 24 | protected override void OnBefore(IInvocation invocation) 25 | { 26 | var validator = (IValidator)Activator.CreateInstance(_validatorType); 27 | var entityType = _validatorType.BaseType.GetGenericArguments()[0]; 28 | var entities = invocation.Arguments.Where(t => t.GetType() == entityType); 29 | foreach (var entity in entities) 30 | { 31 | ValidationTool.Validate(validator, entity); 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Core/Aspects/MyAspects/MyAspect.cs: -------------------------------------------------------------------------------- 1 | using Castle.DynamicProxy; 2 | using Core.Utilities.Interceptors; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace Core.Aspects.MyAspects 8 | { 9 | public class MyAspect : MethodInterception 10 | { 11 | public MyAspect() 12 | { 13 | Console.WriteLine("noname"); 14 | } 15 | public MyAspect(string name) 16 | { 17 | Console.WriteLine("name{0}", name); 18 | } 19 | protected override void OnAfter(IInvocation invocation) 20 | { 21 | Console.WriteLine("Çalışıyor"); 22 | } 23 | protected override void OnBefore(IInvocation invocation) 24 | { 25 | Console.WriteLine("Çaşışmaya başlıyor örnekler hazırlanıyor"); 26 | } 27 | protected override void OnSuccess(IInvocation invocation) 28 | { 29 | Console.WriteLine("Bitti"); 30 | } 31 | protected override void OnException(IInvocation invocation, Exception e) 32 | { 33 | Console.WriteLine("Hatayı aldın {0}", e.ToString()); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Core/Core.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /Core/CrossCuttingConcerns/Caching/ICacheManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.CrossCuttingConcerns.Caching 6 | { 7 | public interface ICacheManager 8 | { 9 | T Get(string key); 10 | object Get(string key); 11 | void Add(string key, object value, int duration); 12 | bool IsAdd(string key); 13 | void Remove(string key); 14 | void RemoveByPattern(string pattern); 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Core/CrossCuttingConcerns/Caching/Microsoft/MemoryCacheManager.cs: -------------------------------------------------------------------------------- 1 | using Core.Utilities.IoC; 2 | using Microsoft.Extensions.Caching.Memory; 3 | using System; 4 | using Microsoft.Extensions.DependencyInjection; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | using System.Text.RegularExpressions; 8 | using System.Linq; 9 | 10 | namespace Core.CrossCuttingConcerns.Caching.Microsoft 11 | { 12 | public class MemoryCacheManager : ICacheManager 13 | { 14 | IMemoryCache _memoryCache; 15 | public MemoryCacheManager() 16 | { 17 | _memoryCache = ServiceTool.ServiceProvider.GetService(); 18 | } 19 | public void Add(string key, object value, int duration) 20 | { 21 | _memoryCache.Set(key, value, TimeSpan.FromMinutes(duration)); 22 | } 23 | 24 | public T Get(string key) 25 | { 26 | return _memoryCache.Get(key); 27 | } 28 | 29 | public object Get(string key) 30 | { 31 | return _memoryCache.Get(key); 32 | } 33 | 34 | public bool IsAdd(string key) 35 | { 36 | return _memoryCache.TryGetValue(key, out _); 37 | } 38 | 39 | public void Remove(string key) 40 | { 41 | _memoryCache.Remove(key); 42 | } 43 | 44 | public void RemoveByPattern(string pattern) 45 | { 46 | var cacheEntriesCollectionDefinition = typeof(MemoryCache).GetProperty("EntriesCollection", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); 47 | var cacheEntriesCollection = cacheEntriesCollectionDefinition.GetValue(_memoryCache) as dynamic; 48 | List cacheCollectionValues = new List(); 49 | 50 | foreach (var cacheItem in cacheEntriesCollection) 51 | { 52 | ICacheEntry cacheItemValue = cacheItem.GetType().GetProperty("Value").GetValue(cacheItem, null); 53 | cacheCollectionValues.Add(cacheItemValue); 54 | } 55 | 56 | var regex = new Regex(pattern, RegexOptions.Singleline | RegexOptions.Compiled | RegexOptions.IgnoreCase); 57 | var keysToRemove = cacheCollectionValues.Where(d => regex.IsMatch(d.Key.ToString())).Select(d => d.Key).ToList(); 58 | 59 | foreach (var key in keysToRemove) 60 | { 61 | _memoryCache.Remove(key); 62 | } 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Core/CrossCuttingConcerns/Validation/FluentValidation/ValidationTool.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities.Concrete; 2 | using Core.Entities; 3 | using Core.Utilities.Results.Abstract; 4 | using Core.Utilities.Results.Concrate; 5 | using FluentValidation; 6 | using FluentValidation.Results; 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Text; 10 | 11 | namespace Business.ValidationRules 12 | { 13 | public static class ValidationTool 14 | { 15 | public static void Validate(IValidator validator, object etity) 16 | { 17 | var context = new ValidationContext(etity); 18 | var result = validator.Validate(context); 19 | if (!result.IsValid) 20 | { 21 | throw new ValidationException(result.Errors); 22 | } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Core/DataAccess/EntityFramework/EfEntityRepositoryBase.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities; 2 | using Microsoft.EntityFrameworkCore; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Linq.Expressions; 7 | using System.Text; 8 | 9 | namespace Core.DataAccess.EntityFramework 10 | { 11 | public class EfEntityRepositoryBase : IEntityRepository 12 | where TEntity : class, IEntity, new() 13 | where TContext : DbContext, new() 14 | { 15 | public void Add(TEntity entity) 16 | { 17 | using (TContext context =new TContext()) 18 | { 19 | var addedEntity = context.Entry(entity); 20 | addedEntity.State = EntityState.Added; 21 | context.SaveChanges(); 22 | } 23 | } 24 | 25 | public void Delete(TEntity entity) 26 | { 27 | using (TContext context = new TContext()) 28 | { 29 | var deletedEntity = context.Entry(entity); 30 | deletedEntity.State = EntityState.Deleted; 31 | context.SaveChanges(); 32 | } 33 | } 34 | 35 | public TEntity Get(Expression> filter) 36 | { 37 | using (TContext context = new TContext()) 38 | { 39 | return context.Set().SingleOrDefault(filter); 40 | } 41 | } 42 | 43 | public List GetAll(Expression> filter = null) 44 | { 45 | using (TContext context = new TContext()) 46 | { 47 | return filter == null 48 | ? context.Set().ToList() 49 | : context.Set().Where(filter).ToList(); 50 | } 51 | } 52 | 53 | public void Update(TEntity entity) 54 | { 55 | using (TContext context = new TContext()) 56 | { 57 | var updatedEntity = context.Entry(entity); 58 | updatedEntity.State = EntityState.Modified; 59 | context.SaveChanges(); 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Core/DataAccess/IEntityRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Linq.Expressions; 5 | using Core.Entities.Concrete; 6 | using Core.Entities; 7 | 8 | namespace Core.DataAccess 9 | { 10 | public interface IEntityRepository where T:class, IEntity, new() 11 | { 12 | List GetAll(Expression> filter = null); 13 | T Get(Expression> filter); 14 | void Add(T entity); 15 | void Update(T entity); 16 | void Delete(T entity); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Core/DependencyResolvers/Autofac/CoreModule.cs: -------------------------------------------------------------------------------- 1 | using Autofac; 2 | using Core.CrossCuttingConcerns.Caching; 3 | using Core.CrossCuttingConcerns.Caching.Microsoft; 4 | using Core.Utilities.IoC; 5 | using Microsoft.AspNetCore.Http; 6 | using Microsoft.Extensions.DependencyInjection; 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Diagnostics; 10 | using System.Text; 11 | 12 | namespace Core.DependencyResolvers.Autofac 13 | { 14 | public class CoreModule : ICoreModule 15 | { 16 | public void Load(IServiceCollection serviceCollection) 17 | { 18 | serviceCollection.AddMemoryCache(); 19 | serviceCollection.AddSingleton(); 20 | serviceCollection.AddSingleton(); 21 | serviceCollection.AddSingleton(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Core/Entities/Concrete/OperationClaim.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Entities.Concrete 6 | { 7 | public class OperationClaim : IEntity 8 | { 9 | public int ID { get; set; } 10 | public string Name { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Core/Entities/Concrete/User.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Entities.Concrete 6 | { 7 | public class User : IEntity 8 | { 9 | public int ID { get; set; } 10 | public string FirstName { get; set; } 11 | public string LastName { get; set; } 12 | public string NickName { get; set; } 13 | public string Email { get; set; } 14 | public byte[] PasswordHash { get; set; } 15 | public byte[] PasswordSalt { get; set; } 16 | public bool Status { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Core/Entities/Concrete/UserOperationClaim.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Core.Entities.Concrete 7 | { 8 | public class UserOperationClaim : IEntity 9 | { 10 | public int ID { get; set; } 11 | public int UserID { get; set; } 12 | public int OperationClaimID { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Core/Entities/IDto.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Entities 6 | { 7 | public interface IDto 8 | { 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Core/Entities/IEntity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Entities 6 | { 7 | public interface IEntity 8 | { 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Core/Extensions/ClaimExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IdentityModel.Tokens.Jwt; 4 | using System.Linq; 5 | using System.Security.Claims; 6 | using System.Text; 7 | 8 | namespace Core.Extensions 9 | { 10 | public static class ClaimExtensions 11 | { 12 | public static void AddEmail(this ICollection claims, string email) 13 | { 14 | claims.Add(new Claim(JwtRegisteredClaimNames.Email, email)); 15 | } 16 | 17 | public static void AddName(this ICollection claims, string name) 18 | { 19 | claims.Add(new Claim(ClaimTypes.Name, name)); 20 | } 21 | 22 | public static void AddNameIdentifier(this ICollection claims, string nameIdentifier) 23 | { 24 | claims.Add(new Claim(ClaimTypes.NameIdentifier, nameIdentifier)); 25 | } 26 | 27 | public static void AddRoles(this ICollection claims, string[] roles) 28 | { 29 | roles.ToList().ForEach(role => claims.Add(new Claim(ClaimTypes.Role, role))); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Core/Extensions/ClaimsPrincipalExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Security.Claims; 5 | using System.Text; 6 | 7 | namespace Core.Extensions 8 | { 9 | public static class ClaimsPrincipalExtensions 10 | { 11 | public static List Claims(this ClaimsPrincipal claimsPrincipal, string claimType) 12 | { 13 | var result = claimsPrincipal?.FindAll(claimType)?.Select(x => x.Value).ToList(); 14 | return result; 15 | } 16 | 17 | public static List ClaimRoles(this ClaimsPrincipal claimsPrincipal) 18 | { 19 | return claimsPrincipal?.Claims(ClaimTypes.Role); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Core/Extensions/ErrorDetails.cs: -------------------------------------------------------------------------------- 1 | using FluentValidation.Results; 2 | using Newtonsoft.Json; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace Core.Extensions 8 | { 9 | public class ErrorDetails 10 | { 11 | public string Message { get; set; } 12 | public int StatusCode { get; set; } 13 | 14 | public override string ToString() 15 | { 16 | return JsonConvert.SerializeObject(this); 17 | } 18 | } 19 | public class ValidationErrorDetail : ErrorDetails 20 | { 21 | public IEnumerable Errors { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Core/Extensions/ExceptionMiddleware.cs: -------------------------------------------------------------------------------- 1 | using FluentValidation; 2 | using FluentValidation.Results; 3 | using Microsoft.AspNetCore.Http; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Net; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace Core.Extensions 11 | { 12 | public class ExceptionMiddleware 13 | { 14 | private RequestDelegate _next; 15 | 16 | public ExceptionMiddleware(RequestDelegate next) 17 | { 18 | _next = next; 19 | } 20 | 21 | public async Task InvokeAsync(HttpContext httpContext) 22 | { 23 | try 24 | { 25 | await _next(httpContext); 26 | } 27 | catch (Exception e) 28 | { 29 | await HandleExceptionAsync(httpContext, e); 30 | } 31 | } 32 | 33 | private Task HandleExceptionAsync(HttpContext httpContext, Exception e) 34 | { 35 | httpContext.Response.ContentType = "application/json"; 36 | httpContext.Response.StatusCode = (int)HttpStatusCode.InternalServerError; 37 | 38 | string message = "Internal Server Error"; 39 | IEnumerable error; 40 | if (e.GetType() == typeof(ValidationException)) 41 | { 42 | message = e.Message; 43 | error = ((ValidationException)e).Errors; 44 | httpContext.Response.StatusCode = 400; 45 | return httpContext.Response.WriteAsync(new ValidationErrorDetail 46 | { 47 | StatusCode = 400, 48 | Message = message, 49 | Errors = error, 50 | }.ToString()); 51 | } 52 | 53 | return httpContext.Response.WriteAsync(new ErrorDetails 54 | { 55 | StatusCode = httpContext.Response.StatusCode, 56 | Message = message 57 | }.ToString()); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Core/Extensions/ExceptionMiddlewareExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Builder; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Core.Extensions 7 | { 8 | public static class ExceptionMiddlewareExtensions 9 | { 10 | public static void ConfigureCustomExceptionMiddleware(this IApplicationBuilder app) 11 | { 12 | app.UseMiddleware(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Core/Extensions/ServiceCollectionExtensions.cs: -------------------------------------------------------------------------------- 1 | using Core.Utilities.IoC; 2 | using Microsoft.Extensions.DependencyInjection; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace Core.Extensions 8 | { 9 | public static class ServiceCollectionExtensions 10 | { 11 | public static IServiceCollection AddDependencyResolvers 12 | (this IServiceCollection servicesCollection, ICoreModule[] modules) 13 | { 14 | foreach (var module in modules) 15 | { 16 | module.Load(servicesCollection); 17 | } 18 | return ServiceTool.Create(servicesCollection); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Core/Utilities/Business/BusinessRules.cs: -------------------------------------------------------------------------------- 1 | using Core.Utilities.Results.Abstract; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Core.Utilities.Business 7 | { 8 | public class BusinessRules 9 | { 10 | public static IResult Run(params IResult[] logics) 11 | { 12 | foreach (var logic in logics) 13 | { 14 | if (!logic.Success) 15 | { 16 | return logic; 17 | } 18 | } 19 | return null; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Core/Utilities/File/Abstract/IFileProp.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Utilities.File 6 | { 7 | public interface IFileProp 8 | { 9 | string Name { get; set; } 10 | string OldPath { get; set; } 11 | string NewPath { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Core/Utilities/File/Abstract/IFileUtilities.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Utilities.File 6 | { 7 | public interface IFileUtilities 8 | { 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Core/Utilities/File/Abstract/IFormFileProp.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Core.Utilities.File 7 | { 8 | public interface IFormFileProp : IFileProp 9 | { 10 | IFormFile[] FormFiles { get; set; } 11 | IFormFile FormFile { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Core/Utilities/File/Abstract/IImageSaveBase.cs: -------------------------------------------------------------------------------- 1 | namespace Core.Utilities.File 2 | { 3 | public partial class FileUtilities 4 | { 5 | public interface IImageSaveBase 6 | { 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Core/Utilities/File/Concrete/AbcSave.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using static Core.Utilities.File.FileUtilities; 5 | namespace Core.Utilities.File.Concrete 6 | { 7 | public class AbcSave : ImageSaveBase 8 | { 9 | public override IEnumerable Save(IFormFileProp formFileProp) 10 | { 11 | throw new NotImplementedException(); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Core/Utilities/File/Concrete/Base/ImageSaveBase.cs: -------------------------------------------------------------------------------- 1 | using Core.Utilities.File.Concrete; 2 | using System.Collections.Generic; 3 | 4 | namespace Core.Utilities.File 5 | { 6 | public partial class FileUtilities 7 | { 8 | public abstract class ImageSaveBase : IImageSaveBase 9 | { 10 | public abstract IEnumerable Save(IFormFileProp formFileProp); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Core/Utilities/File/Concrete/FileUtilities.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.Text; 6 | 7 | namespace Core.Utilities.File 8 | { 9 | public partial class FileUtilities : IFileUtilities 10 | { 11 | public static string FileExtension(string path) 12 | { 13 | string fileExtension = path.Substring(path.IndexOf("."), path.Length - path.IndexOf(".")); 14 | return fileExtension; 15 | } 16 | public static string GetFileName(string path) 17 | { 18 | if (path.IndexOf(@"/") > -1) 19 | { 20 | return path.Substring(path.LastIndexOf(@"/"), path.Length - path.LastIndexOf(@"/")); 21 | } 22 | else if (path.IndexOf(@"\") > -1) 23 | { 24 | return path.Substring(path.LastIndexOf(@"\"), path.Length - path.LastIndexOf(@"\")); 25 | } 26 | return null; 27 | } 28 | public static bool CheckIfImageFile(string imagePath) 29 | { 30 | var extension = imagePath.Substring(imagePath.IndexOf("."), imagePath.Length - imagePath.IndexOf(".")); 31 | 32 | bool result = (extension == ".jpg" || extension == ".jpeg" || extension == ".png"); 33 | if (!result) return false; 34 | 35 | return true; 36 | } 37 | 38 | public static bool CheckIfImageFile(List files) 39 | { 40 | //bool result = false; 41 | foreach (var file in files) 42 | { 43 | var extension = Path.GetExtension(file.FileName); 44 | 45 | bool result = (extension == ".jpg" || extension == ".jpeg" || extension == ".png"); 46 | if (!result) return false; 47 | } 48 | return true; 49 | } 50 | 51 | public static bool CheckIfImageFile(IFormFile file) 52 | { 53 | var extension = Path.GetExtension(file.FileName); 54 | 55 | bool result = (extension == ".jpg" || extension == ".jpeg" || extension == ".png"); 56 | if (!result) return false; 57 | 58 | return true; 59 | } 60 | public static string NameGuid() 61 | { 62 | return Guid.NewGuid().ToString(); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Core/Utilities/File/Concrete/FormFileImageSave.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | using static Core.Utilities.File.FileUtilities; 6 | 7 | namespace Core.Utilities.File.Concrete 8 | { 9 | public class FormFileImageSave : ImageSaveBase 10 | { 11 | 12 | public override IEnumerable Save(IFormFileProp formFileProp) 13 | { 14 | 15 | string[] result = new string[1]; 16 | if (formFileProp.Name == null) 17 | { 18 | formFileProp.Name = GetFileName(formFileProp.OldPath); 19 | } 20 | 21 | string carImagePathAndName = formFileProp.NewPath + formFileProp.Name + FileExtension(formFileProp.FormFile.FileName); 22 | if (string.IsNullOrEmpty(formFileProp.FormFile.FileName) == false) 23 | { 24 | using (var stream = new FileStream(carImagePathAndName, FileMode.Create)) 25 | formFileProp.FormFile.CopyTo(stream); 26 | } 27 | result[0] = formFileProp.Name + FileExtension(formFileProp.FormFile.FileName); 28 | return result; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Core/Utilities/File/Concrete/FormFilesImageSave.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | using static Core.Utilities.File.FileUtilities; 6 | 7 | namespace Core.Utilities.File.Concrete 8 | { 9 | public class FormFilesImageSave : ImageSaveBase 10 | { 11 | public override IEnumerable Save(IFormFileProp formFileProp) 12 | { 13 | string[] result = new string[formFileProp.FormFiles.Length]; 14 | for (int i = 0; i < formFileProp.FormFiles.Length; i++) 15 | { 16 | if (formFileProp.Name == null) 17 | { 18 | formFileProp.Name = GetFileName(formFileProp.OldPath); 19 | } 20 | formFileProp.Name = FileUtilities.NameGuid(); 21 | string carImagePathAndName = formFileProp.NewPath + formFileProp.Name + FileExtension(formFileProp.FormFiles[i].FileName); 22 | if (string.IsNullOrEmpty(formFileProp.FormFiles[i].FileName) == false) 23 | { 24 | using (var stream = new FileStream(carImagePathAndName, FileMode.Create)) 25 | formFileProp.FormFiles[i].CopyTo(stream); 26 | } 27 | result[i] = formFileProp.Name + FileExtension(formFileProp.FormFiles[i].FileName); 28 | } 29 | return result; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Core/Utilities/File/Concrete/MusicSave.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using static Core.Utilities.File.FileUtilities; 5 | 6 | namespace Core.Utilities.File.Concrete 7 | { 8 | public class MusicSave : ImageSaveBase 9 | { 10 | public override IEnumerable Save(IFormFileProp formFileProp) 11 | { 12 | throw new NotImplementedException(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Core/Utilities/File/Concrete/NormalImageSave.cs: -------------------------------------------------------------------------------- 1 | using Core.Utilities.File.Concrete; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | 6 | namespace Core.Utilities.File 7 | { 8 | public partial class FileUtilities 9 | { 10 | public class NormalImageSave : ImageSaveBase 11 | { 12 | public override IEnumerable Save(IFormFileProp formFileProp) 13 | { 14 | string[] result = new string[1]; 15 | if (formFileProp.Name == null) 16 | { 17 | formFileProp.Name = GetFileName(formFileProp.OldPath); 18 | } 19 | 20 | string carImagePathAndName = formFileProp.NewPath + formFileProp.Name + FileExtension(formFileProp.OldPath); 21 | if (string.IsNullOrEmpty(formFileProp.OldPath) == false && System.IO.File.Exists(formFileProp.OldPath) == true) 22 | { 23 | using (StreamWriter streamWriter = new StreamWriter(carImagePathAndName)) 24 | { 25 | using (FileStream source = System.IO.File.Open(formFileProp.OldPath, FileMode.Open)) 26 | { 27 | source.CopyTo(streamWriter.BaseStream); 28 | source.Flush(); 29 | source.Dispose(); 30 | source.Close(); 31 | } 32 | streamWriter.Flush(); 33 | streamWriter.Dispose(); 34 | streamWriter.Close(); 35 | } 36 | result[0] = formFileProp.Name + FileExtension(formFileProp.OldPath); 37 | } 38 | 39 | return result; 40 | } 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Core/Utilities/File/Concrete/Prop/FileProp.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Utilities.File.Concrete 6 | { 7 | public class FileProp : IFileProp 8 | { 9 | public string Name { get; set; } 10 | public string OldPath { get; set; } 11 | public string NewPath { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Core/Utilities/File/Concrete/Prop/FormFileProp.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Core.Utilities.File.Concrete 7 | { 8 | public class FormFileProp : IFormFileProp 9 | { 10 | public IFormFile[] FormFiles { get; set; } 11 | public IFormFile FormFile { get; set; } 12 | public string Name { get; set; } 13 | public string OldPath { get; set; } 14 | public string NewPath { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Core/Utilities/File/Concrete/Prop/MusicProp.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Utilities.File.Concrete.Prop 6 | { 7 | class MusicProp 8 | { 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Core/Utilities/Interceptors/AspectInterceptorSelector.cs: -------------------------------------------------------------------------------- 1 | using Castle.DynamicProxy; 2 | using System; 3 | using System.Linq; 4 | using System.Reflection; 5 | 6 | namespace Core.Utilities.Interceptors 7 | { 8 | public class AspectInterceptorSelector : IInterceptorSelector 9 | { 10 | public IInterceptor[] SelectInterceptors(Type type, MethodInfo method, IInterceptor[] interceptors) 11 | { 12 | var classAttributes = type.GetCustomAttributes 13 | (true).ToList(); 14 | var methodAttributes = type.GetMethod(method.Name) 15 | .GetCustomAttributes(true); 16 | classAttributes.AddRange(methodAttributes); 17 | 18 | return classAttributes.OrderBy(x => x.Priority).ToArray(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Core/Utilities/Interceptors/MethodInterception.cs: -------------------------------------------------------------------------------- 1 | using Castle.DynamicProxy; 2 | using System; 3 | 4 | namespace Core.Utilities.Interceptors 5 | { 6 | public abstract class MethodInterception : MethodInterceptionBaseAttribute 7 | { 8 | protected virtual void OnBefore(IInvocation invocation) { } 9 | protected virtual void OnAfter(IInvocation invocation) { } 10 | protected virtual void OnException(IInvocation invocation, System.Exception e) { } 11 | protected virtual void OnSuccess(IInvocation invocation) { } 12 | public override void Intercept(IInvocation invocation) 13 | { 14 | var isSuccess = true; 15 | OnBefore(invocation); 16 | try 17 | { 18 | invocation.Proceed(); 19 | } 20 | catch (Exception e) 21 | { 22 | isSuccess = false; 23 | OnException(invocation, e); 24 | throw; 25 | } 26 | finally 27 | { 28 | if (isSuccess) 29 | { 30 | OnSuccess(invocation); 31 | } 32 | } 33 | OnAfter(invocation); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Core/Utilities/Interceptors/MethodInterceptionBaseAttribute.cs: -------------------------------------------------------------------------------- 1 | using Castle.DynamicProxy; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Core.Utilities.Interceptors 7 | { 8 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)] 9 | public abstract class MethodInterceptionBaseAttribute : Attribute, IInterceptor 10 | { 11 | public int Priority { get; set; } 12 | 13 | public virtual void Intercept(IInvocation invocation) 14 | { 15 | 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Core/Utilities/IoC/ICoreModule.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Core.Utilities.IoC 7 | { 8 | public interface ICoreModule 9 | { 10 | void Load(IServiceCollection serviceCollection); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Core/Utilities/IoC/ServiceTool.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Core.Utilities.IoC 7 | { 8 | public static class ServiceTool 9 | { 10 | public static IServiceProvider ServiceProvider { get; private set; } 11 | 12 | public static IServiceCollection Create(IServiceCollection services) 13 | { 14 | ServiceProvider = services.BuildServiceProvider(); 15 | return services; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Core/Utilities/Messages/AspectMessages.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Runtime.Serialization; 4 | using System.Text; 5 | 6 | namespace Core.Utilities.Messages 7 | { 8 | public class AspectMessages 9 | { 10 | public static string ValidationInvalid = "Bu bir doğrulama kodu değildir."; 11 | public static string GSearchInvalid="Bu bir GSearch özelliğidir."; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Core/Utilities/Results/Abstract/IDataResult.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Utilities.Results.Abstract 6 | { 7 | public interface IDataResult : IResult 8 | { 9 | T Data { get; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Core/Utilities/Results/Abstract/IResult.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Utilities.Results.Abstract 6 | { 7 | public interface IResult 8 | { 9 | bool Success { get; } 10 | string Message { get; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Core/Utilities/Results/Concrate/DataResult/DataResult.cs: -------------------------------------------------------------------------------- 1 | using Core.Utilities.Results.Abstract; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Core.Utilities.Results.Concrate 7 | { 8 | public class DataResult:Result,IDataResult 9 | { 10 | public T Data { get; } 11 | public DataResult(T data,bool success,string message):base(success,message) 12 | { 13 | Data = data; 14 | } 15 | public DataResult(T data,bool success):base(success) 16 | { 17 | Data = data; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Core/Utilities/Results/Concrate/DataResult/ErrorDataResult.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Utilities.Results.Concrate 6 | { 7 | public class ErrorDataResult : DataResult 8 | { 9 | public ErrorDataResult(T data, string message) : base(data, false, message) 10 | { 11 | 12 | } 13 | public ErrorDataResult(string message) : base(default, false, message) 14 | { 15 | 16 | } 17 | public ErrorDataResult(T data) : base(data, false) 18 | { 19 | 20 | } 21 | public ErrorDataResult() : base(default, false) 22 | { 23 | 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Core/Utilities/Results/Concrate/DataResult/SuccessDataResult.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Utilities.Results.Concrate 6 | { 7 | public class SuccessDataResult:DataResult 8 | { 9 | //hepsi olan 10 | public SuccessDataResult(T data,string message):base(data,true,message) 11 | { 12 | 13 | } 14 | //mesajsız olan 15 | public SuccessDataResult(T data):base(data,true) 16 | { 17 | 18 | } 19 | public SuccessDataResult(string message):base(default,true,message) 20 | { 21 | 22 | } 23 | public SuccessDataResult():base(default,true) 24 | { 25 | 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Core/Utilities/Results/Concrate/Result/ErrorResult.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Utilities.Results.Concrate 6 | { 7 | public class ErrorResult:Result 8 | { 9 | public ErrorResult(string message):base(false,message) 10 | { 11 | 12 | } 13 | public ErrorResult():base(false) 14 | { 15 | 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Core/Utilities/Results/Concrate/Result/Result.cs: -------------------------------------------------------------------------------- 1 | using Core.Utilities.Results.Abstract; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Core.Utilities.Results.Concrate 7 | { 8 | public class Result : IResult 9 | { 10 | public bool Success { get; } 11 | 12 | public string Message { get; } 13 | 14 | public Result(bool success,string message):this(success) 15 | { 16 | Message = message; 17 | } 18 | public Result(bool success) 19 | { 20 | Success = success; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Core/Utilities/Results/Concrate/Result/SuccessResult.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Utilities.Results.Concrate 6 | { 7 | public class SuccessResult:Result 8 | { 9 | public SuccessResult(string message):base(true,message) 10 | { 11 | 12 | } 13 | public SuccessResult():base(true) 14 | { 15 | 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Core/Utilities/Results/Notes.txt: -------------------------------------------------------------------------------- 1 | Olay: 2 | Void için Result iişlem yap bitir mantığı 3 | Geri dönüşlü metotlar için datalı DataResult döndürerek işlem yap mesaj gönder. 4 | 5 | default ayrımı default kelime olarak T türünün objesinin en temel hali 6 | değişkenlerin ise temel hali 7 | örnek : 8 | string default empty 9 | T türünün defaultu object -------------------------------------------------------------------------------- /Core/Utilities/Security/Encryption/SecurityKeyHelper.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.IdentityModel.Tokens; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Core.Utilities.Security.Encryption 7 | { 8 | public class SecurityKeyHelper 9 | { 10 | public static SecurityKey CreateSecurityKey(string securityKey) 11 | { 12 | return new SymmetricSecurityKey(Encoding.UTF8.GetBytes(securityKey)); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Core/Utilities/Security/Encryption/SigningCredentialsHelper.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.IdentityModel.Tokens; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Core.Utilities.Security.Encryption 7 | { 8 | public class SigningCredentialsHelper 9 | { 10 | public static SigningCredentials CreateSigningCredentials(SecurityKey securityKey) 11 | { 12 | return new SigningCredentials(securityKey, SecurityAlgorithms.HmacSha256Signature); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Core/Utilities/Security/Hashing/HashingHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Utilities.Security.Hashing 6 | { 7 | public class HashingHelper 8 | { 9 | public static void CreatePasswordHash(string password, out byte[] passwordHash, out byte[] passwordSalt) 10 | { 11 | using (var hmac = new System.Security.Cryptography.HMACSHA512()) 12 | { 13 | passwordSalt = hmac.Key; 14 | passwordHash = hmac.ComputeHash(Encoding.UTF8.GetBytes(password)); 15 | } 16 | } 17 | 18 | public static bool VerifyPasswordHash(string password, byte[] passwordHash, byte[] passwordSalt) 19 | { 20 | using (var hmac = new System.Security.Cryptography.HMACSHA512(passwordSalt)) 21 | { 22 | var computedHash = hmac.ComputeHash(Encoding.UTF8.GetBytes(password)); 23 | for (int i = 0; i < computedHash.Length; i++) 24 | { 25 | if (computedHash[i] != passwordHash[i]) 26 | { 27 | return false; 28 | } 29 | } 30 | } 31 | 32 | return true; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Core/Utilities/Security/Jwt/AccessToken.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Utilities.Security.Jwt 6 | { 7 | public class AccessToken 8 | { 9 | public string Token { get; set; } 10 | public DateTime Expiration { get; set; } 11 | 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Core/Utilities/Security/Jwt/ITokenHelper.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities.Concrete; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | namespace Core.Utilities.Security.Jwt 6 | { 7 | public interface ITokenHelper 8 | { 9 | AccessToken CreateToken(User user, List operationClaims); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Core/Utilities/Security/Jwt/JwtHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IdentityModel.Tokens.Jwt; 4 | using System.Linq; 5 | using System.Security.Claims; 6 | using System.Text; 7 | using Core.Entities.Concrete; 8 | using Core.Extensions; 9 | using Core.Utilities.Security.Encryption; 10 | using Microsoft.Extensions.Configuration; 11 | using Microsoft.IdentityModel.Tokens; 12 | 13 | namespace Core.Utilities.Security.Jwt 14 | { 15 | public class JwtHelper : ITokenHelper 16 | { 17 | public IConfiguration Configuration { get; } 18 | private TokenOptions _tokenOptions; 19 | private DateTime _accessTokenExpiration; 20 | public JwtHelper(IConfiguration configuration) 21 | { 22 | Configuration = configuration; 23 | _tokenOptions = Configuration.GetSection("TokenOptions").Get(); 24 | 25 | } 26 | public AccessToken CreateToken(User user, List operationClaims) 27 | { 28 | _accessTokenExpiration = DateTime.Now.AddMinutes(_tokenOptions.AccessTokenExpiration); 29 | var securityKey = SecurityKeyHelper.CreateSecurityKey(_tokenOptions.SecurityKey); 30 | var signingCredentials = SigningCredentialsHelper.CreateSigningCredentials(securityKey); 31 | var jwt = CreateJwtSecurityToken(_tokenOptions, user, signingCredentials, operationClaims); 32 | var jwtSecurityTokenHandler = new JwtSecurityTokenHandler(); 33 | var token = jwtSecurityTokenHandler.WriteToken(jwt); 34 | 35 | return new AccessToken 36 | { 37 | Token = token, 38 | Expiration = _accessTokenExpiration 39 | }; 40 | 41 | } 42 | 43 | public JwtSecurityToken CreateJwtSecurityToken(TokenOptions tokenOptions, User user, 44 | SigningCredentials signingCredentials, List operationClaims) 45 | { 46 | var jwt = new JwtSecurityToken( 47 | issuer: tokenOptions.Issuer, 48 | audience: tokenOptions.Audience, 49 | expires: _accessTokenExpiration, 50 | notBefore: DateTime.Now, 51 | claims: SetClaims(user, operationClaims), 52 | signingCredentials: signingCredentials 53 | ); 54 | return jwt; 55 | } 56 | 57 | private IEnumerable SetClaims(User user, List operationClaims) 58 | { 59 | var claims = new List(); 60 | claims.AddNameIdentifier(user.ID.ToString()); 61 | claims.AddEmail(user.Email); 62 | claims.AddName($"{user.FirstName} {user.LastName}"); 63 | claims.AddRoles(operationClaims.Select(c => c.Name).ToArray()); 64 | 65 | return claims; 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Core/Utilities/Security/Jwt/TokenOptions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Core.Utilities.Security.Jwt 6 | { 7 | public class TokenOptions 8 | { 9 | public string Audience { get; set; } 10 | public string Issuer { get; set; } 11 | public int AccessTokenExpiration { get; set; } 12 | public string SecurityKey { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DataAccess/Abstract/IBrandDal.cs: -------------------------------------------------------------------------------- 1 |  2 | using Core.DataAccess; 3 | using Entities.Concrete; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace DataAccess.Abstract 9 | { 10 | public interface IBrandDal:IEntityRepository 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DataAccess/Abstract/ICarDal.cs: -------------------------------------------------------------------------------- 1 | using Core.DataAccess; 2 | using Entities.Concrete; 3 | using Entities.Dtos; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq.Expressions; 7 | using System.Text; 8 | namespace DataAccess.Abstract 9 | { 10 | public interface ICarDal : IEntityRepository 11 | { 12 | List GetCarDetails(); 13 | List GetCarDetails(Expression> filter = null); 14 | List GetCarImageDetails(Expression> filter = null); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DataAccess/Abstract/ICarImageDal.cs: -------------------------------------------------------------------------------- 1 | using Core.DataAccess; 2 | using Entities.Concrete; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace DataAccess.Abstract 8 | { 9 | public interface ICarImageDal:IEntityRepository 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /DataAccess/Abstract/IColorDal.cs: -------------------------------------------------------------------------------- 1 |  2 | using Core.DataAccess; 3 | using Entities.Concrete; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace DataAccess.Abstract 9 | { 10 | public interface IColorDal:IEntityRepository 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DataAccess/Abstract/ICreditCardDal.cs: -------------------------------------------------------------------------------- 1 | using Core.DataAccess; 2 | using Entities.Concrete; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace DataAccess.Abstract 8 | { 9 | public interface ICreditCardDal: IEntityRepository 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /DataAccess/Abstract/ICustomerDal.cs: -------------------------------------------------------------------------------- 1 | using Core.DataAccess; 2 | using Entities.Concrete; 3 | using Entities.Dtos; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq.Expressions; 7 | using System.Text; 8 | 9 | namespace DataAccess.Abstract 10 | { 11 | public interface ICustomerDal : IEntityRepository 12 | { 13 | List GetCustomerDetails(Expression> filter = null); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DataAccess/Abstract/IFindexDal.cs: -------------------------------------------------------------------------------- 1 | using Core.DataAccess; 2 | using Entities.Concrete; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace DataAccess.Abstract 8 | { 9 | public interface IFindexDal:IEntityRepository 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /DataAccess/Abstract/IRentalDal.cs: -------------------------------------------------------------------------------- 1 | using Core.DataAccess; 2 | using Entities.Concrete; 3 | using Entities.Dtos; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq.Expressions; 7 | using System.Text; 8 | 9 | namespace DataAccess.Abstract 10 | { 11 | public interface IRentalDal : IEntityRepository 12 | { 13 | List GetAllRentalDetailDto(Expression> filter = null); 14 | RentalDetailDto GetRentalDetailDto(Expression> filter = null); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DataAccess/Abstract/IUserDal.cs: -------------------------------------------------------------------------------- 1 | using Core.DataAccess; 2 | using Core.Entities.Concrete; 3 | using Entities.Dtos; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace DataAccess.Abstract 9 | { 10 | public interface IUserDal:IEntityRepository 11 | { 12 | List GetCustomerDetails(); 13 | List GetClaims(User user); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DataAccess/Concrete/EntityFramework/EfBrandDal.cs: -------------------------------------------------------------------------------- 1 | using Core.DataAccess.EntityFramework; 2 | using DataAccess.Abstract; 3 | using Entities.Concrete; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace DataAccess.Concrete.EntityFramework 9 | { 10 | public class EfBrandDal:EfEntityRepositoryBase,IBrandDal 11 | { 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DataAccess/Concrete/EntityFramework/EfCarDal.cs: -------------------------------------------------------------------------------- 1 | using Core.DataAccess.EntityFramework; 2 | using DataAccess.Abstract; 3 | using Entities.Concrete; 4 | using Entities.Dtos; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Linq.Expressions; 9 | using System.Text; 10 | 11 | namespace DataAccess.Concrete.EntityFramework 12 | { 13 | public class EfCarDal : EfEntityRepositoryBase, ICarDal 14 | { 15 | public List GetCarImageDetails(Expression> filter = null) 16 | { 17 | using (ReCapDemoContext context = new ReCapDemoContext()) 18 | { 19 | var result = from p in context.Cars 20 | join k in context.Colors on p.ColorID equals k.ID 21 | join l in context.Brands on p.BrandID equals l.ID 22 | join m in context.CarImages on p.ID equals m.CarID 23 | select new CarImageDetailDto 24 | { 25 | ID = m.ID, 26 | BrandName = k.ColorName, 27 | ColorName = l.BrandName, 28 | CarID = p.ID, 29 | DailyPrice = p.DailyPrice, 30 | Date = m.Date, 31 | Description = p.Description, 32 | ImagePath = m.ImagePath, 33 | ModelYear = p.ModelYear 34 | }; 35 | return result.Where(filter).ToList(); 36 | } 37 | } 38 | public List GetCarDetails() 39 | { 40 | using (ReCapDemoContext context = new ReCapDemoContext()) 41 | { 42 | var result = from p in context.Cars 43 | join k in context.Colors on p.ColorID equals k.ID 44 | join l in context.Brands on p.BrandID equals l.ID 45 | select new CarDetailDto { ID = p.ID, ColorName = k.ColorName, BrandName = l.BrandName, DailyPrice = p.DailyPrice, Description = p.Description, ModelYear = p.ModelYear }; 46 | return result.ToList(); 47 | } 48 | } 49 | public List GetCarDetails(Expression> filter = null) 50 | { 51 | using (ReCapDemoContext context = new ReCapDemoContext()) 52 | { 53 | var result = from p in filter == null ? context.Cars : context.Cars.Where(filter) 54 | join k in context.Colors on p.ColorID equals k.ID 55 | join l in context.Brands on p.BrandID equals l.ID 56 | select new CarDetailDto { ID = p.ID, ColorName = k.ColorName, BrandName = l.BrandName, DailyPrice = p.DailyPrice, Description = p.Description, ModelYear = p.ModelYear }; 57 | return result.ToList(); 58 | } 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /DataAccess/Concrete/EntityFramework/EfCarImageDal.cs: -------------------------------------------------------------------------------- 1 | using Core.DataAccess.EntityFramework; 2 | using DataAccess.Abstract; 3 | using Entities.Concrete; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace DataAccess.Concrete.EntityFramework 9 | { 10 | public class EfCarImageDal:EfEntityRepositoryBase,ICarImageDal 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DataAccess/Concrete/EntityFramework/EfColorDal.cs: -------------------------------------------------------------------------------- 1 | using Core.DataAccess.EntityFramework; 2 | using DataAccess.Abstract; 3 | using Entities.Concrete; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace DataAccess.Concrete.EntityFramework 9 | { 10 | public class EfColorDal:EfEntityRepositoryBase,IColorDal 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DataAccess/Concrete/EntityFramework/EfCreditCardDal.cs: -------------------------------------------------------------------------------- 1 | using Core.DataAccess.EntityFramework; 2 | using DataAccess.Abstract; 3 | using Entities.Concrete; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace DataAccess.Concrete.EntityFramework 9 | { 10 | public class EfCreditCardDal: EfEntityRepositoryBase,ICreditCardDal 11 | { 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DataAccess/Concrete/EntityFramework/EfCustomerDal.cs: -------------------------------------------------------------------------------- 1 | using Core.DataAccess.EntityFramework; 2 | using DataAccess.Abstract; 3 | using Entities.Concrete; 4 | using Entities.Dtos; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq.Expressions; 8 | using System.Linq; 9 | using System.Text; 10 | 11 | namespace DataAccess.Concrete.EntityFramework 12 | { 13 | public class EfCustomerDal : EfEntityRepositoryBase, ICustomerDal 14 | { 15 | public List GetCustomerDetails(Expression> filter = null) 16 | { 17 | using (ReCapDemoContext context = new ReCapDemoContext()) 18 | { 19 | var result = from p in context.Customers 20 | join k in context.Users on p.UserID equals k.ID 21 | select new CustomerDetailDto { ID = p.ID, CompanyName = p.CompanyName, Email = k.Email, FirstName = k.FirstName, LastName = k.LastName, NickName = k.NickName }; 22 | return result.ToList(); 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /DataAccess/Concrete/EntityFramework/EfFindexDal.cs: -------------------------------------------------------------------------------- 1 | using Core.DataAccess.EntityFramework; 2 | using DataAccess.Abstract; 3 | using Entities.Concrete; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace DataAccess.Concrete.EntityFramework 9 | { 10 | public class EfFindexDal: EfEntityRepositoryBase,IFindexDal 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DataAccess/Concrete/EntityFramework/EfRentalDal.cs: -------------------------------------------------------------------------------- 1 | using Core.DataAccess.EntityFramework; 2 | using DataAccess.Abstract; 3 | using Entities.Concrete; 4 | using Entities.Dtos; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq.Expressions; 8 | using System.Linq; 9 | using System.Text; 10 | 11 | namespace DataAccess.Concrete.EntityFramework 12 | { 13 | public class EfRentalDal : EfEntityRepositoryBase, IRentalDal 14 | { 15 | public List GetAllRentalDetailDto(Expression> filter = null) 16 | { 17 | using (ReCapDemoContext context = new ReCapDemoContext()) 18 | { 19 | var result = from p in context.Rentals 20 | join k in context.Customers on p.CustomerID equals k.ID 21 | join t in context.Cars on p.CarID equals t.ID 22 | join l in context.Brands on t.BrandID equals l.ID 23 | join m in context.Users on k.UserID equals m.ID 24 | 25 | select new RentalDetailDto 26 | { 27 | ID = p.ID, 28 | CarID = t.ID, 29 | BrandName = l.BrandName, 30 | CustomerID = p.CustomerID, 31 | FullName = m.FirstName + m.LastName, 32 | RentDate = p.RentDate, 33 | ReturnDate = p.ReturnDate, 34 | isEnabled = p.ReturnDate == null ? false : true 35 | }; 36 | return filter == null ? result.ToList() : result.Where(filter).ToList(); 37 | } 38 | } 39 | public RentalDetailDto GetRentalDetailDto(Expression> filter = null) 40 | { 41 | using (ReCapDemoContext context = new ReCapDemoContext()) 42 | { 43 | var result = from p in context.Rentals 44 | join k in context.Customers on p.CustomerID equals k.ID 45 | join t in context.Cars on p.CarID equals t.ID 46 | join l in context.Brands on t.BrandID equals l.ID 47 | join m in context.Users on k.UserID equals m.ID 48 | select new RentalDetailDto 49 | { 50 | ID = p.ID, 51 | CarID = t.ID, 52 | BrandName = l.BrandName, 53 | CustomerID = p.CustomerID, 54 | FullName = m.FirstName + m.LastName, 55 | RentDate = p.RentDate, 56 | ReturnDate = p.ReturnDate, 57 | isEnabled = p.ReturnDate == null ? false : true 58 | }; 59 | return filter == null ? result.FirstOrDefault() : result.Where(filter).FirstOrDefault(); 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /DataAccess/Concrete/EntityFramework/EfUserDal.cs: -------------------------------------------------------------------------------- 1 | using Core.DataAccess.EntityFramework; 2 | using DataAccess.Abstract; 3 | using Core.Entities.Concrete; 4 | using Entities.Concrete; 5 | using Entities.Dtos; 6 | using System; 7 | using System.Collections.Generic; 8 | using System.Text; 9 | using System.Linq; 10 | 11 | namespace DataAccess.Concrete.EntityFramework 12 | { 13 | public class EfUserDal : EfEntityRepositoryBase, IUserDal 14 | { 15 | public List GetCustomerDetails() 16 | { 17 | using (ReCapDemoContext context = new ReCapDemoContext()) 18 | { 19 | var result = from p in context.Customers 20 | join k in context.Users on p.UserID equals k.ID 21 | select new CustomerDetailDto { ID = p.ID, CompanyName = p.CompanyName, Email = k.Email, FirstName = k.FirstName, LastName = k.LastName, NickName = k.NickName }; 22 | return result.ToList(); 23 | } 24 | } 25 | public List GetClaims(User user) 26 | { 27 | using (var context = new ReCapDemoContext()) 28 | { 29 | var result = from operationClaim in context.OperationClaims 30 | join userOperationClaim in context.UserOperationClaims 31 | on operationClaim.ID equals userOperationClaim.OperationClaimID 32 | where userOperationClaim.UserID == user.ID 33 | select new OperationClaim { ID = operationClaim.ID, Name = operationClaim.Name }; 34 | return result.ToList(); 35 | 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /DataAccess/Concrete/EntityFramework/ReCapDemoContext.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities.Concrete; 2 | using Entities.Concrete; 3 | using Microsoft.EntityFrameworkCore; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Text; 7 | 8 | namespace DataAccess.Concrete.EntityFramework 9 | { 10 | public class ReCapDemoContext : DbContext 11 | { 12 | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 13 | { 14 | optionsBuilder.UseSqlServer(@"Server=(localdb)\MSSQLLocalDB;Database=ReCapProject;Trusted_Connection=True;"); 15 | } 16 | public DbSet Cars { get; set; } 17 | public DbSet Colors { get; set; } 18 | public DbSet Brands { get; set; } 19 | public DbSet Users { get; set; } 20 | public DbSet Customers { get; set; } 21 | public DbSet Rentals { get; set; } 22 | public DbSet CarImages { get; set; } 23 | public DbSet CreditCards { get; set; } 24 | public DbSet OperationClaims { get; set; } 25 | public DbSet UserOperationClaims { get; set; } 26 | 27 | protected override void OnModelCreating(ModelBuilder modelBuilder) 28 | { 29 | modelBuilder 30 | .Entity() 31 | .HasOne(e => e.CustomerProp) 32 | .WithOne(e => e.RentalProp) 33 | .OnDelete(DeleteBehavior.ClientCascade); 34 | modelBuilder 35 | .Entity() 36 | .HasOne(e => e.RentalProp) 37 | .WithOne(e => e.CustomerProp) 38 | .OnDelete(DeleteBehavior.ClientCascade); 39 | modelBuilder 40 | .Entity() 41 | .HasOne(e => e.BrandProp) 42 | .WithOne(e => e.CarProp) 43 | .OnDelete(DeleteBehavior.ClientCascade); 44 | modelBuilder 45 | .Entity() 46 | .HasOne(e => e.CarProp) 47 | .WithOne(e => e.ColorProp) 48 | .OnDelete(DeleteBehavior.ClientCascade); 49 | modelBuilder 50 | .Entity() 51 | .HasOne(e => e.CarProp) 52 | .WithOne(e => e.BrandProp) 53 | .OnDelete(DeleteBehavior.ClientCascade); 54 | modelBuilder 55 | .Entity() 56 | .HasOne(e => e.CarProp) 57 | .WithOne(e => e.CarImageProp) 58 | .OnDelete(DeleteBehavior.ClientCascade); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /DataAccess/Concrete/InMemory/InMemoryCarDal.cs: -------------------------------------------------------------------------------- 1 | using DataAccess.Abstract; 2 | using Entities.Concrete; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | using System.Linq; 7 | using System.Linq.Expressions; 8 | using Entities.Dtos; 9 | 10 | namespace DataAccess.Concrate 11 | { 12 | public class InMemoryCarDal : ICarDal 13 | { 14 | List _cars; 15 | public InMemoryCarDal() 16 | { 17 | _cars = new List { 18 | new Car{ID=1,BrandID=1,ColorID=1,DailyPrice=15,Description="ab",ModelYear=1999}, 19 | new Car{ID=2,BrandID=2,ColorID=2,DailyPrice=10,Description="abc",ModelYear=1999}, 20 | new Car{ID=3,BrandID=2,ColorID=3,DailyPrice=5,Description="abcd",ModelYear=1999}, 21 | new Car{ID=4,BrandID=3,ColorID=3,DailyPrice=1,Description="abce",ModelYear=1999}, 22 | }; 23 | } 24 | public void Add(Car car) 25 | { 26 | _cars.Add(car); 27 | } 28 | 29 | public void Delete(Car car) 30 | { 31 | Car carToDelete = _cars.SingleOrDefault(p => p.ID == car.ID); 32 | _cars.Remove(carToDelete); 33 | } 34 | 35 | public Car Get(Expression> filter) 36 | { 37 | throw new NotImplementedException(); 38 | } 39 | 40 | public List GetAll() 41 | { 42 | return _cars; 43 | } 44 | 45 | public List GetAll(Expression> filter = null) 46 | { 47 | throw new NotImplementedException(); 48 | } 49 | 50 | public List GetById(int CarId) 51 | { 52 | var ListedId = _cars.Where(p => p.ID == CarId).ToList(); 53 | return ListedId; 54 | } 55 | 56 | public List GetCarDetailDtoByXId(Expression> filter = null) 57 | { 58 | throw new NotImplementedException(); 59 | } 60 | 61 | public List GetCarDetails() 62 | { 63 | throw new NotImplementedException(); 64 | } 65 | 66 | public List GetCarDetails(Expression> filter = null) 67 | { 68 | throw new NotImplementedException(); 69 | } 70 | 71 | public List GetCarImageDetails(Expression> filter = null) 72 | { 73 | throw new NotImplementedException(); 74 | } 75 | 76 | public List GetCarImageDetails(Expression> filter = null) 77 | { 78 | throw new NotImplementedException(); 79 | } 80 | 81 | public void Update(Car car) 82 | { 83 | Car carToUpdate = _cars.SingleOrDefault(p => p.ID == car.ID); 84 | carToUpdate.ModelYear = car.ModelYear; 85 | carToUpdate.Description = car.Description; 86 | carToUpdate.DailyPrice = car.DailyPrice; 87 | carToUpdate.ColorID = car.ColorID; 88 | carToUpdate.BrandID = car.BrandID; 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /DataAccess/DataAccess.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Entities/Concrete/Brand.cs: -------------------------------------------------------------------------------- 1 |  2 | using Core.Entities; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace Entities.Concrete 8 | { 9 | public class Brand:IEntity 10 | { 11 | public int ID { get; set; } 12 | public string BrandName { get; set; } 13 | public Car CarProp { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Entities/Concrete/Car.cs: -------------------------------------------------------------------------------- 1 |  2 | using Core.Entities; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace Entities.Concrete 8 | { 9 | 10 | public class Car : IEntity 11 | { 12 | public int ID { get; set; } 13 | public int? BrandID { get; set; } 14 | public int? ColorID { get; set; } 15 | public int ModelYear { get; set; } 16 | public int DailyPrice { get; set; } 17 | public string Description { get; set; } 18 | public Brand BrandProp { get; set; } 19 | public Color ColorProp { get; set; } 20 | public Rental RentalProp { get; set; } 21 | public CarImage CarImageProp { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Entities/Concrete/CarImage.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities; 2 | using Microsoft.AspNetCore.Http; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.ComponentModel.DataAnnotations.Schema; 6 | using System.Text; 7 | 8 | namespace Entities.Concrete 9 | { 10 | public class CarImage : IEntity 11 | { 12 | public int ID { get; set; } 13 | public int CarID { get; set; } 14 | public string? ImagePath { get; set; } 15 | public DateTime? Date { get; set; } 16 | public Car CarProp { get; set; } 17 | 18 | [NotMapped] 19 | public IFormFile ImageFile { get; set; } 20 | 21 | [NotMapped] 22 | public IFormFile[] ImageFiles { get; set; } 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Entities/Concrete/Color.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Entities.Concrete 7 | { 8 | public class Color:IEntity 9 | { 10 | public int ID { get; set; } 11 | public string ColorName { get; set; } 12 | public Car CarProp { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Entities/Concrete/CreditCard.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Entities.Concrete 7 | { 8 | public class CreditCard:IEntity 9 | { 10 | public int Id { get; set; } 11 | public string Guid { get; set; } 12 | public int UserId { get; set; } 13 | public string CardName { get; set; } 14 | public string CardNumber { get; set; } 15 | public string Expiration { get; set; } 16 | public DateTime Date { get; set; } 17 | public int Cvv { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Entities/Concrete/Customer.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Entities.Concrete 7 | { 8 | public class Customer:IEntity 9 | { 10 | public int ID { get; set; } 11 | public int UserID { get; set; } 12 | public string CompanyName { get; set; } 13 | public Rental RentalProp { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Entities/Concrete/Findex.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Entities.Concrete 7 | { 8 | public class Findex:IEntity 9 | { 10 | public int Id { get; set; } 11 | public int FindexNum { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Entities/Concrete/Payment.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Entities.Concrete 7 | { 8 | public class Payment:IEntity 9 | { 10 | public int Id { get; set; } 11 | public string Guid { get; set; } 12 | public int Name { get; set; } 13 | public string CardId { get; set; } 14 | public string CardName { get; set; } 15 | public DateTime Date { get; set; } 16 | public string Cvv { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Entities/Concrete/Rental.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Entities.Concrete 7 | { 8 | public class Rental:IEntity 9 | { 10 | public int ID { get; set; } 11 | public int CarID { get; set; } 12 | public int CustomerID { get; set; } 13 | public DateTime RentDate { get; set; } 14 | public DateTime? ReturnDate { get; set; } 15 | public bool IsEnabled { get; set; } 16 | public Car CarProp { get; set; } 17 | public Customer CustomerProp { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Entities/Dtos/CarDetailDto.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Entities.Dtos 7 | { 8 | public class CarDetailDto:IDto 9 | { 10 | public int ID { get; set; } 11 | public string BrandName { get; set; } 12 | public string ColorName { get; set; } 13 | public string Description { get; set; } 14 | public int ModelYear { get; set; } 15 | public decimal DailyPrice { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Entities/Dtos/CarImageDetailDto.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities; 2 | using Entities.Concrete; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace Entities.Dtos 8 | { 9 | public class CarImageDetailDto : IDto 10 | { 11 | public int ID { get; set; } 12 | public int CarID { get; set; } 13 | public string BrandName { get; set; } 14 | public string ColorName { get; set; } 15 | public int ModelYear { get; set; } 16 | public int DailyPrice { get; set; } 17 | public string Description { get; set; } 18 | public string ImagePath { get; set; } 19 | public DateTime? Date { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Entities/Dtos/CarImageFormFile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Entities.Dtos 6 | { 7 | class CarImageFormFile 8 | { 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Entities/Dtos/CustomerDetailDto.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Entities.Dtos 7 | { 8 | public class CustomerDetailDto:IDto 9 | { 10 | public int ID { get; set; } 11 | public string FirstName { get; set; } 12 | public string LastName { get; set; } 13 | public string NickName { get; set; } 14 | public string Email { get; set; } 15 | public string CompanyName { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Entities/Dtos/RentalDetailDto.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Entities.Dtos 7 | { 8 | public class RentalDetailDto : IDto 9 | { 10 | public int ID { get; set; } 11 | public int CarID { get; set; } 12 | public int CustomerID { get; set; } 13 | public DateTime RentDate { get; set; } 14 | public DateTime? ReturnDate { get; set; } 15 | public string BrandName { get; set; } 16 | public string FullName { get; set; } 17 | public bool isEnabled { get; set; } 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Entities/Dtos/UserForLoginDto.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Entities.Dtos 7 | { 8 | public class UserForLoginDto : IDto 9 | { 10 | public string Email { get; set; } 11 | public string Password { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Entities/Dtos/UserForRegisterDto.cs: -------------------------------------------------------------------------------- 1 | using Core.Entities; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Entities.Dtos 7 | { 8 | public class UserForRegisterDto : IDto 9 | { 10 | public string Email { get; set; } 11 | public string Password { get; set; } 12 | public string FirstName { get; set; } 13 | public string LastName { get; set; } 14 | public string NickName { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Entities/Entities.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ReCapProject 2 | 3 | # Enes Özmert 4 | 5 | Dc:isimkullanmiyorum 6 | 7 | efyaz.com sahibi 8 | 9 | kodlama.io ödevi : Memeory List için Katmanlı Mimari Özeti 10 | 11 | 08.02.2021 core katmanı ve inner join ile tablo araları veri birleştirme adımları yapıldı. 12 | 13 | 12.02.2021 core katmanına result yapısı eklendi ve araba'nın telim edilip edilmediği ve kiralanma olayları eklendi 14 | Result yapısı FluentValidation tool hataları ile birleştirildi. 15 | 16 | 26.02.2021 arabalar icin resim sitemi kuruldu iş kodları yazıldı istenilen özellikler yazıldı. 17 | 01.03.2021 JWT altyapısı kuruldu ve resim kayıt sistemi strategy desing patterne taşındı. 18 | 19 | # Türkçe İlave Açıklamalar: 20 | Diğer yapılmış olan projelerden farklılıkları ve artıları nelerdir. 21 | 22 | -1-Tek tuş ile Çoklu araba kiralanabilinir. 23 | -2-Back End Kısmında Resimler ayrı bir katmanda tutulup sadece o resim istek olunca wwwroot a oluşturulur ve silinir. 24 | -3-Ödeme 3 aşamalıdır sepete ekleme araba kiralama ön izleme ve ödeme işlemleridir. 25 | -4-Resimler static file olarak açılmamış xhrs sorgusu ile file olarak gelmektedir. 26 | -5-Resimler için File Helper yapısı kuruldu bu yapıda strategy desing patter kullanıldı. İleriye yönelik her türlü file save işlemleri yapıya eklenebiliyor 27 | -6-Kayıt olurken şifre güvenlğini ölcen ve gösteren yapı geliştirilmiştir. 28 | -7-İleriye yönelik komut istemi ile işlemlerin yapılabileceği yapı hazırlanmıştır. 29 | Bunlar haricinde web sayfası şu şekilde görünmektedir. 30 | 31 | 32 | -------------------------------------------------------------------------------- /ReCapProject.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30907.101 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Entities", "Entities\Entities.csproj", "{B6B9EDAA-ED67-4B83-B338-DBE2DE5B8C82}" 7 | EndProject 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataAccess", "DataAccess\DataAccess.csproj", "{F7A8146C-DC98-4D2E-B0BA-45C6597DDA13}" 9 | EndProject 10 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Business", "Business\Business.csproj", "{8F71031B-DFB4-4F6E-BA8F-128857AB6588}" 11 | EndProject 12 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleUI", "ConsoleUI\ConsoleUI.csproj", "{AF922660-1C2B-4EE5-82ED-19492C21D2C0}" 13 | EndProject 14 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core", "Core\Core.csproj", "{25FA8167-9200-40A0-84E6-522C3E39404C}" 15 | EndProject 16 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebAPI", "WebAPI\WebAPI.csproj", "{05F758C5-A4FC-4AB6-B0C0-9D0A924A847D}" 17 | EndProject 18 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Storage", "Storage\Storage.csproj", "{2A231F9B-07B6-4970-A7A8-F513A2073634}" 19 | EndProject 20 | Global 21 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 22 | Debug|Any CPU = Debug|Any CPU 23 | Release|Any CPU = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 26 | {B6B9EDAA-ED67-4B83-B338-DBE2DE5B8C82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {B6B9EDAA-ED67-4B83-B338-DBE2DE5B8C82}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {B6B9EDAA-ED67-4B83-B338-DBE2DE5B8C82}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {B6B9EDAA-ED67-4B83-B338-DBE2DE5B8C82}.Release|Any CPU.Build.0 = Release|Any CPU 30 | {F7A8146C-DC98-4D2E-B0BA-45C6597DDA13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 31 | {F7A8146C-DC98-4D2E-B0BA-45C6597DDA13}.Debug|Any CPU.Build.0 = Debug|Any CPU 32 | {F7A8146C-DC98-4D2E-B0BA-45C6597DDA13}.Release|Any CPU.ActiveCfg = Release|Any CPU 33 | {F7A8146C-DC98-4D2E-B0BA-45C6597DDA13}.Release|Any CPU.Build.0 = Release|Any CPU 34 | {8F71031B-DFB4-4F6E-BA8F-128857AB6588}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 35 | {8F71031B-DFB4-4F6E-BA8F-128857AB6588}.Debug|Any CPU.Build.0 = Debug|Any CPU 36 | {8F71031B-DFB4-4F6E-BA8F-128857AB6588}.Release|Any CPU.ActiveCfg = Release|Any CPU 37 | {8F71031B-DFB4-4F6E-BA8F-128857AB6588}.Release|Any CPU.Build.0 = Release|Any CPU 38 | {AF922660-1C2B-4EE5-82ED-19492C21D2C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 39 | {AF922660-1C2B-4EE5-82ED-19492C21D2C0}.Debug|Any CPU.Build.0 = Debug|Any CPU 40 | {AF922660-1C2B-4EE5-82ED-19492C21D2C0}.Release|Any CPU.ActiveCfg = Release|Any CPU 41 | {AF922660-1C2B-4EE5-82ED-19492C21D2C0}.Release|Any CPU.Build.0 = Release|Any CPU 42 | {25FA8167-9200-40A0-84E6-522C3E39404C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 43 | {25FA8167-9200-40A0-84E6-522C3E39404C}.Debug|Any CPU.Build.0 = Debug|Any CPU 44 | {25FA8167-9200-40A0-84E6-522C3E39404C}.Release|Any CPU.ActiveCfg = Release|Any CPU 45 | {25FA8167-9200-40A0-84E6-522C3E39404C}.Release|Any CPU.Build.0 = Release|Any CPU 46 | {05F758C5-A4FC-4AB6-B0C0-9D0A924A847D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 47 | {05F758C5-A4FC-4AB6-B0C0-9D0A924A847D}.Debug|Any CPU.Build.0 = Debug|Any CPU 48 | {05F758C5-A4FC-4AB6-B0C0-9D0A924A847D}.Release|Any CPU.ActiveCfg = Release|Any CPU 49 | {05F758C5-A4FC-4AB6-B0C0-9D0A924A847D}.Release|Any CPU.Build.0 = Release|Any CPU 50 | {2A231F9B-07B6-4970-A7A8-F513A2073634}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 51 | {2A231F9B-07B6-4970-A7A8-F513A2073634}.Debug|Any CPU.Build.0 = Debug|Any CPU 52 | {2A231F9B-07B6-4970-A7A8-F513A2073634}.Release|Any CPU.ActiveCfg = Release|Any CPU 53 | {2A231F9B-07B6-4970-A7A8-F513A2073634}.Release|Any CPU.Build.0 = Release|Any CPU 54 | EndGlobalSection 55 | GlobalSection(SolutionProperties) = preSolution 56 | HideSolutionNode = FALSE 57 | EndGlobalSection 58 | GlobalSection(ExtensibilityGlobals) = postSolution 59 | SolutionGuid = {DC87B96F-31B5-48AB-B678-FBC148E98ED7} 60 | EndGlobalSection 61 | EndGlobal 62 | -------------------------------------------------------------------------------- /Storage/CarImages/06cadb47-2e26-47a5-beea-140094296a78.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/06cadb47-2e26-47a5-beea-140094296a78.jpg -------------------------------------------------------------------------------- /Storage/CarImages/0a6a6319-93e6-4777-87c2-39dd660c9fdb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/0a6a6319-93e6-4777-87c2-39dd660c9fdb.jpg -------------------------------------------------------------------------------- /Storage/CarImages/0dd898f8-2258-48a9-baf5-8a0bb748a908.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/0dd898f8-2258-48a9-baf5-8a0bb748a908.jpg -------------------------------------------------------------------------------- /Storage/CarImages/10a7e68c-d0fe-4318-bbac-ebe3cc6cdfee.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/10a7e68c-d0fe-4318-bbac-ebe3cc6cdfee.jpg -------------------------------------------------------------------------------- /Storage/CarImages/1174d4c9-acab-42f6-800d-f1f4bf8511c1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/1174d4c9-acab-42f6-800d-f1f4bf8511c1.jpg -------------------------------------------------------------------------------- /Storage/CarImages/11b48bad-045d-4206-be73-75d4fe16b6a0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/11b48bad-045d-4206-be73-75d4fe16b6a0.jpg -------------------------------------------------------------------------------- /Storage/CarImages/17b8597d-36f6-4c0f-b7d8-aa7bcf090987.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/17b8597d-36f6-4c0f-b7d8-aa7bcf090987.jpg -------------------------------------------------------------------------------- /Storage/CarImages/1b07e30e-a48d-43d8-a63e-473bf46020c4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/1b07e30e-a48d-43d8-a63e-473bf46020c4.jpg -------------------------------------------------------------------------------- /Storage/CarImages/1f2cd81e-d0bd-4f59-94a2-070dd6f5ae2d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/1f2cd81e-d0bd-4f59-94a2-070dd6f5ae2d.jpg -------------------------------------------------------------------------------- /Storage/CarImages/1ff56a2b-aa47-493b-8b2b-cbfa0a5774ba.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/1ff56a2b-aa47-493b-8b2b-cbfa0a5774ba.jpg -------------------------------------------------------------------------------- /Storage/CarImages/20a8c9f1-4291-469d-966d-4cb17cdf7fa8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/20a8c9f1-4291-469d-966d-4cb17cdf7fa8.png -------------------------------------------------------------------------------- /Storage/CarImages/22958191-3702-489f-822b-c5bff11dfa51.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/22958191-3702-489f-822b-c5bff11dfa51.jpg -------------------------------------------------------------------------------- /Storage/CarImages/26c46d24-ccf0-4ccb-bcf6-a2b661d181b8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/26c46d24-ccf0-4ccb-bcf6-a2b661d181b8.jpg -------------------------------------------------------------------------------- /Storage/CarImages/2a1085b0-9605-47b4-a51d-95055418b270.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/2a1085b0-9605-47b4-a51d-95055418b270.jpg -------------------------------------------------------------------------------- /Storage/CarImages/3a558fe6-156c-43fb-8989-d632d4acd5f5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/3a558fe6-156c-43fb-8989-d632d4acd5f5.jpg -------------------------------------------------------------------------------- /Storage/CarImages/3a96b150-b5b7-4f04-8669-f86d8e380c80.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/3a96b150-b5b7-4f04-8669-f86d8e380c80.jpg -------------------------------------------------------------------------------- /Storage/CarImages/40fcd418-fe6a-4a04-9bdc-23beee2edf56.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/40fcd418-fe6a-4a04-9bdc-23beee2edf56.jpg -------------------------------------------------------------------------------- /Storage/CarImages/4eaca2e1-852a-4c98-aa31-afc185d8733c.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/4eaca2e1-852a-4c98-aa31-afc185d8733c.jpg -------------------------------------------------------------------------------- /Storage/CarImages/50c2692d-9e2d-4df3-8cab-4a1a05623dbc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/50c2692d-9e2d-4df3-8cab-4a1a05623dbc.jpg -------------------------------------------------------------------------------- /Storage/CarImages/51219c8e-6e05-40e3-b6e8-413285158a54.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/51219c8e-6e05-40e3-b6e8-413285158a54.jpg -------------------------------------------------------------------------------- /Storage/CarImages/61092f87-7d71-4f2d-bcef-8d0835c48916.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/61092f87-7d71-4f2d-bcef-8d0835c48916.jpg -------------------------------------------------------------------------------- /Storage/CarImages/68105f6c-4828-4631-b422-330d795126cb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/68105f6c-4828-4631-b422-330d795126cb.jpg -------------------------------------------------------------------------------- /Storage/CarImages/69009443-068e-4945-b4b6-4b3cd9116651.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/69009443-068e-4945-b4b6-4b3cd9116651.jpg -------------------------------------------------------------------------------- /Storage/CarImages/6aab46a6-d98a-4714-975c-b575f077d8c1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/6aab46a6-d98a-4714-975c-b575f077d8c1.jpg -------------------------------------------------------------------------------- /Storage/CarImages/6bea425f-428c-480e-93a6-76551abfe22b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/6bea425f-428c-480e-93a6-76551abfe22b.jpg -------------------------------------------------------------------------------- /Storage/CarImages/7e3dba04-d81b-4e56-9b2c-885ee3b8bc77.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/7e3dba04-d81b-4e56-9b2c-885ee3b8bc77.jpg -------------------------------------------------------------------------------- /Storage/CarImages/7ea088bb-f66d-4e96-8c5c-6d395b3a41ad.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/7ea088bb-f66d-4e96-8c5c-6d395b3a41ad.jpg -------------------------------------------------------------------------------- /Storage/CarImages/8e6d33c5-a867-478c-b393-ecf22123d3bf.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/8e6d33c5-a867-478c-b393-ecf22123d3bf.jpg -------------------------------------------------------------------------------- /Storage/CarImages/915acba9-878b-458e-8b7f-f4f36294aee5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/915acba9-878b-458e-8b7f-f4f36294aee5.jpg -------------------------------------------------------------------------------- /Storage/CarImages/96857e74-8f60-4a76-995f-5c54867e86dc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/96857e74-8f60-4a76-995f-5c54867e86dc.jpg -------------------------------------------------------------------------------- /Storage/CarImages/9afc4068-36af-4029-bbb9-5040b1621930.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/9afc4068-36af-4029-bbb9-5040b1621930.jpg -------------------------------------------------------------------------------- /Storage/CarImages/RentACarImageDefault.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/RentACarImageDefault.jpg -------------------------------------------------------------------------------- /Storage/CarImages/a8d779b4-e8ce-46b2-823b-e95bd89f48cd.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/a8d779b4-e8ce-46b2-823b-e95bd89f48cd.jpg -------------------------------------------------------------------------------- /Storage/CarImages/b11b2eca-ed36-41c4-bc8c-1beeef84a211.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/b11b2eca-ed36-41c4-bc8c-1beeef84a211.jpg -------------------------------------------------------------------------------- /Storage/CarImages/c0b96b83-e12e-4aef-a8d8-136ee2a34564.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/c0b96b83-e12e-4aef-a8d8-136ee2a34564.png -------------------------------------------------------------------------------- /Storage/CarImages/c1894752-de9e-4005-bdfe-336390ae6626.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/c1894752-de9e-4005-bdfe-336390ae6626.jpg -------------------------------------------------------------------------------- /Storage/CarImages/c1f6885e-e201-463f-9f94-6f857c02fdcd.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/c1f6885e-e201-463f-9f94-6f857c02fdcd.jpg -------------------------------------------------------------------------------- /Storage/CarImages/c53a7219-aec8-4f66-ac0d-5a1bcae6b61d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/c53a7219-aec8-4f66-ac0d-5a1bcae6b61d.jpg -------------------------------------------------------------------------------- /Storage/CarImages/c699d0e7-188e-40bc-bfe4-4ef3c0a49c34.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/c699d0e7-188e-40bc-bfe4-4ef3c0a49c34.jpg -------------------------------------------------------------------------------- /Storage/CarImages/c7488adb-691c-4fc5-8da2-ab53a36d2e42.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/c7488adb-691c-4fc5-8da2-ab53a36d2e42.png -------------------------------------------------------------------------------- /Storage/CarImages/c8270866-2699-4f08-b3d4-c96f3632e375.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/c8270866-2699-4f08-b3d4-c96f3632e375.jpg -------------------------------------------------------------------------------- /Storage/CarImages/c9b2a485-2c6e-409b-b30c-cd599ebb08c7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/c9b2a485-2c6e-409b-b30c-cd599ebb08c7.jpg -------------------------------------------------------------------------------- /Storage/CarImages/d7319707-b9da-4fc3-863f-929a26024a88.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/d7319707-b9da-4fc3-863f-929a26024a88.jpg -------------------------------------------------------------------------------- /Storage/CarImages/d8ed4519-06a4-465b-af58-35e48e2a67ac.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/d8ed4519-06a4-465b-af58-35e48e2a67ac.jpg -------------------------------------------------------------------------------- /Storage/CarImages/e4a05474-f6ca-4edb-a34c-707ed6833d2b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/e4a05474-f6ca-4edb-a34c-707ed6833d2b.jpg -------------------------------------------------------------------------------- /Storage/CarImages/e57293ae-d13d-4d55-9e2f-de284869c442.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/e57293ae-d13d-4d55-9e2f-de284869c442.jpg -------------------------------------------------------------------------------- /Storage/CarImages/enes.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/enes.txt -------------------------------------------------------------------------------- /Storage/CarImages/enes1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/enes1.txt -------------------------------------------------------------------------------- /Storage/CarImages/f37e128a-ceb2-49b7-8518-8245cd5ce6d7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/f37e128a-ceb2-49b7-8518-8245cd5ce6d7.jpg -------------------------------------------------------------------------------- /Storage/CarImages/f51f4a58-af0c-4c54-afea-852e67aff658.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/f51f4a58-af0c-4c54-afea-852e67aff658.jpg -------------------------------------------------------------------------------- /Storage/CarImages/f9625188-e9f6-4266-b364-410719041336.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/f9625188-e9f6-4266-b364-410719041336.jpg -------------------------------------------------------------------------------- /Storage/CarImages/fd502c3d-beaa-4673-a915-24f47b2dbbab.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/Storage/CarImages/fd502c3d-beaa-4673-a915-24f47b2dbbab.jpg -------------------------------------------------------------------------------- /Storage/Storage.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Storage/StorageControl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Storage 4 | { 5 | public class StorageControl 6 | { 7 | 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Storage/StorageFilePath.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | using System.Reflection; 6 | namespace Storage 7 | { 8 | public class StorageFilePath 9 | { 10 | public static string GetPathCarImages() 11 | { 12 | string result = GetPathMain() + @"CarImages\"; 13 | return result; 14 | } 15 | public static string GetPathMain() 16 | { 17 | var myType = typeof(StorageFilePath); 18 | string myTypeOfNamespace = myType.Namespace; 19 | string storageFilePathNoName = Directory.GetParent(System.IO.Path.GetDirectoryName(new System.Uri(System.Reflection.Assembly.GetExecutingAssembly().CodeBase).LocalPath)).Parent.Parent.Parent.FullName; 20 | string result = storageFilePathNoName + @"\" + myTypeOfNamespace + @"\"; 21 | return result; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /WebAPI/Controllers/AuthController.cs: -------------------------------------------------------------------------------- 1 | using Business.Abstract; 2 | using Entities.Dtos; 3 | using Microsoft.AspNetCore.Http; 4 | using Microsoft.AspNetCore.Mvc; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Threading.Tasks; 9 | 10 | namespace WebAPI.Controllers 11 | { 12 | [Route("api/[controller]")] 13 | [ApiController] 14 | public class AuthController : ControllerBase 15 | { 16 | private IAuthService _authService; 17 | 18 | public AuthController(IAuthService authService) 19 | { 20 | _authService = authService; 21 | } 22 | 23 | [HttpPost("login")] 24 | public ActionResult Login(UserForLoginDto userForLoginDto) 25 | { 26 | var userToLogin = _authService.Login(userForLoginDto); 27 | if (!userToLogin.Success) 28 | { 29 | return BadRequest(userToLogin.Message); 30 | } 31 | 32 | var result = _authService.CreateAccessToken(userToLogin.Data); 33 | if (result.Success) 34 | { 35 | return Ok(result); 36 | } 37 | 38 | return BadRequest(result.Message); 39 | } 40 | 41 | [HttpPost("register")] 42 | public ActionResult Register(UserForRegisterDto userForRegisterDto) 43 | { 44 | var userExists = _authService.UserExists(userForRegisterDto.Email); 45 | if (!userExists.Success) 46 | { 47 | return BadRequest(userExists.Message); 48 | } 49 | 50 | var registerResult = _authService.Register(userForRegisterDto, userForRegisterDto.Password); 51 | var result = _authService.CreateAccessToken(registerResult.Data); 52 | if (result.Success) 53 | { 54 | return Ok(result); 55 | } 56 | 57 | return BadRequest(result.Message); 58 | } 59 | } 60 | } 61 | 62 | -------------------------------------------------------------------------------- /WebAPI/Controllers/BrandsController.cs: -------------------------------------------------------------------------------- 1 | using Business.Abstract; 2 | using Entities.Concrete; 3 | using Microsoft.AspNetCore.Http; 4 | using Microsoft.AspNetCore.Mvc; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Threading.Tasks; 9 | 10 | namespace WebAPI.Controllers 11 | { 12 | [Route("api/[controller]")] 13 | [ApiController] 14 | public class BrandsController : ControllerBase 15 | { 16 | IBrandService _brandService; 17 | 18 | public BrandsController(IBrandService brandService) 19 | { 20 | _brandService = brandService; 21 | } 22 | [HttpPost("add")] 23 | public IActionResult Add(Brand brand) 24 | { 25 | var result = _brandService.Add(brand); 26 | if (result.Success == true) 27 | { 28 | return Ok(result); 29 | } 30 | return BadRequest(result); 31 | } 32 | 33 | [HttpPost("update")] 34 | public IActionResult Update(Brand brand) 35 | { 36 | var result = _brandService.Update(brand); 37 | if (result.Success == true) 38 | { 39 | return Ok(result); 40 | } 41 | return BadRequest(result); 42 | 43 | } 44 | 45 | [HttpPost("delete")] 46 | public IActionResult Delete(Brand brand) 47 | { 48 | var result = _brandService.Delete(brand); 49 | if (result.Success == true) 50 | { 51 | return Ok(result); 52 | } 53 | return BadRequest(result); 54 | } 55 | 56 | [HttpGet("getbyid")] 57 | public IActionResult GetById(int id) 58 | { 59 | var result = _brandService.GetById(id); 60 | if (result.Success == true) 61 | { 62 | return Ok(result); 63 | } 64 | return BadRequest(result); 65 | } 66 | 67 | [HttpGet("getall")] 68 | public IActionResult GetAll() 69 | { 70 | var result = _brandService.GetAll(); 71 | if (result.Success == true) 72 | { 73 | return Ok(result); 74 | } 75 | return BadRequest(result); 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /WebAPI/Controllers/CarImagesController.cs: -------------------------------------------------------------------------------- 1 | using Business.Abstract; 2 | using Core.Utilities.Results.Concrate; 3 | using Entities.Concrete; 4 | using Microsoft.AspNetCore.Http; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Storage; 7 | using System; 8 | using System.Collections.Generic; 9 | using System.IO; 10 | using System.Linq; 11 | using System.Threading.Tasks; 12 | using System.Drawing; 13 | using Microsoft.AspNetCore.Hosting; 14 | using Core.Utilities.Results.Abstract; 15 | using System.Threading; 16 | using Core.Utilities.File; 17 | using System.Net.Http.Headers; 18 | using static Core.Utilities.File.FileUtilities; 19 | using Core.Utilities.File.Concrete; 20 | 21 | namespace WebAPI.Controllers 22 | { 23 | [Route("api/[controller]")] 24 | [ApiController] 25 | public class CarImagesController : ControllerBase 26 | { 27 | ICarImageService _carImageService; 28 | private readonly IWebHostEnvironment _env; 29 | private string _carImagePathNoName = StorageFilePath.GetPathCarImages(); 30 | public CarImagesController(ICarImageService carImageService, IWebHostEnvironment env) 31 | { 32 | _carImageService = carImageService; 33 | _env = env; 34 | } 35 | 36 | [HttpPost("add")] 37 | public IActionResult Add(CarImage carImage) 38 | { 39 | var imageSave = new NormalImageSave(); 40 | _carImageService.ImageSaveBase(imageSave); 41 | var result = _carImageService.Add(carImage); 42 | if (result.Success == true) 43 | { 44 | return Ok(result); 45 | } 46 | return BadRequest(result); 47 | } 48 | //#region FormFile 49 | [HttpPost("addformfile")] 50 | public IActionResult AddBatch([FromForm] CarImage carImage) 51 | { 52 | var imageSave = new FormFileImageSave(); 53 | _carImageService.ImageSaveBase(imageSave); 54 | var result = _carImageService.AddFormFile(carImage); 55 | if (result.Success == true) 56 | { 57 | return Ok(result); 58 | } 59 | return BadRequest(result); 60 | } 61 | [HttpPost("addformfilebatch")] 62 | public IActionResult AddFormFileBatch([FromForm] CarImage carImage) 63 | { 64 | var imageSave = new FormFilesImageSave(); 65 | _carImageService.ImageSaveBase(imageSave); 66 | var result = _carImageService.AddFormFileBatch(carImage); 67 | if (result.Success == true) 68 | { 69 | return Ok(result); 70 | } 71 | return BadRequest(result); 72 | } 73 | //#endregion 74 | [HttpPost("update")] 75 | public IActionResult Update(CarImage carImage) 76 | { 77 | var result = _carImageService.Update(carImage); 78 | if (result.Success == true) 79 | { 80 | return Ok(result); 81 | } 82 | return BadRequest(result); 83 | 84 | } 85 | 86 | [HttpPost("delete")] 87 | public IActionResult Delete(CarImage carImage) 88 | { 89 | var result = _carImageService.Delete(carImage); 90 | if (result.Success == true) 91 | { 92 | return Ok(result); 93 | } 94 | return BadRequest(result); 95 | } 96 | 97 | [HttpGet("getbyid")] 98 | public IActionResult GetById(int id) 99 | { 100 | var result = _carImageService.GetById(id); 101 | if (result.Success == true) 102 | { 103 | return Ok(result); 104 | } 105 | return BadRequest(result); 106 | } 107 | 108 | [HttpGet("getall")] 109 | public IActionResult GetAll() 110 | { 111 | var result = _carImageService.GetAll(); 112 | if (result.Success == true) 113 | { 114 | return Ok(result); 115 | } 116 | return BadRequest(result); 117 | } 118 | //token süresi ile image sil 119 | //bellek , disk 120 | [HttpGet("view")] 121 | //[Route("api/Temp/{dataImagePath}")] 122 | public IActionResult View(int id) 123 | { 124 | var imageSave = new NormalImageSave(); 125 | _carImageService.ImageSaveBase(imageSave); 126 | var result = _carImageService.View(id, _env.WebRootPath); 127 | if (result.Success == true) 128 | { 129 | string fileExtension = result.Data.Name.Substring(result.Data.Name.IndexOf("."), result.Data.Name.Length - result.Data.Name.IndexOf(".")); 130 | return File(result.Data, @"image/" + fileExtension.Replace(".", "")); 131 | } 132 | return BadRequest(result); 133 | 134 | } 135 | #region Methods 136 | 137 | 138 | #endregion 139 | 140 | 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /WebAPI/Controllers/CarsController.cs: -------------------------------------------------------------------------------- 1 | using Business.Abstract; 2 | using DataAccess.Abstract; 3 | using Entities.Concrete; 4 | using Microsoft.AspNetCore.Http; 5 | using Microsoft.AspNetCore.Mvc; 6 | using System; 7 | using System.Collections.Generic; 8 | using System.Linq; 9 | using System.Linq.Expressions; 10 | using System.Threading.Tasks; 11 | 12 | namespace WebAPI.Controllers 13 | { 14 | [Route("api/[controller]")] 15 | [ApiController] 16 | public class CarsController : ControllerBase 17 | { 18 | ICarService _carService; 19 | public CarsController(ICarService carService) 20 | { 21 | _carService = carService; 22 | } 23 | 24 | [HttpPost("add")] 25 | public IActionResult Add(Car car) 26 | { 27 | var result = _carService.Add(car); 28 | if (result.Success == true) 29 | { 30 | return Ok(result); 31 | } 32 | return BadRequest(result); 33 | } 34 | 35 | [HttpPost("update")] 36 | public IActionResult Update(Car car) 37 | { 38 | var result = _carService.Update(car); 39 | if (result.Success == true) 40 | { 41 | return Ok(result); 42 | } 43 | return BadRequest(result); 44 | 45 | } 46 | 47 | [HttpPost("delete")] 48 | public IActionResult Delete(Car car) 49 | { 50 | var result = _carService.Delete(car); 51 | if (result.Success == true) 52 | { 53 | return Ok(result); 54 | } 55 | return BadRequest(result); 56 | } 57 | 58 | [HttpGet("getbyid")] 59 | public IActionResult GetById(int id) 60 | { 61 | var result = _carService.GetById(id); 62 | if (result.Success == true) 63 | { 64 | return Ok(result); 65 | } 66 | return BadRequest(result); 67 | } 68 | 69 | [HttpGet("getall")] 70 | public IActionResult GetAll() 71 | { 72 | var result = _carService.GetAll(); 73 | if (result.Success == true) 74 | { 75 | return Ok(result); 76 | } 77 | return BadRequest(result); 78 | } 79 | 80 | [HttpGet("getcardetails")] 81 | public IActionResult GetCarDetails() 82 | { 83 | var result = _carService.GetCarDetails(); 84 | if (result.Success == true) 85 | { 86 | return Ok(result); 87 | } 88 | return BadRequest(result); 89 | } 90 | [HttpGet("getcarimagedetails")] 91 | public IActionResult GetCarImageDetails(int carId) 92 | { 93 | var result = _carService.GetCarImageDetails(carId); 94 | if (result.Success == true) 95 | { 96 | return Ok(result); 97 | } 98 | return BadRequest(result); 99 | } 100 | [HttpGet("getcardetailsbybrandId")] 101 | public IActionResult GetCarDetailsByBrandId(int brandId) 102 | { 103 | var result = _carService.GetCarDetailsByBrandId(brandId); 104 | if (result.Success == true) 105 | { 106 | return Ok(result); 107 | } 108 | return BadRequest(result); 109 | } 110 | [HttpGet("getcardetailsbycolorId")] 111 | public IActionResult GetCarDetailsByColorId(int colorId) 112 | { 113 | var result = _carService.GetCarDetailsByColorId(colorId); 114 | if (result.Success == true) 115 | { 116 | return Ok(result); 117 | } 118 | return BadRequest(result); 119 | } 120 | [HttpGet("getcardetailsbycolorIdorbrandId")] 121 | public IActionResult GetCarDetailsByColorOrBrandId(int colorId, int brandId) 122 | { 123 | var result = _carService.GetCarDetailsByColorOrBrandId(colorId, brandId); 124 | if (result.Success == true) 125 | { 126 | return Ok(result); 127 | } 128 | return BadRequest(result); 129 | } 130 | [HttpGet("getcardetailsbyId")] 131 | public IActionResult GetCarDetailsById(int carId) 132 | { 133 | var result = _carService.GetCarDetailsById(carId); 134 | if (result.Success == true) 135 | { 136 | return Ok(result); 137 | } 138 | return BadRequest(result); 139 | } 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /WebAPI/Controllers/ColorsController.cs: -------------------------------------------------------------------------------- 1 | using Business.Abstract; 2 | using Entities.Concrete; 3 | using Microsoft.AspNetCore.Http; 4 | using Microsoft.AspNetCore.Mvc; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Threading.Tasks; 9 | 10 | namespace WebAPI.Controllers 11 | { 12 | [Route("api/[controller]")] 13 | [ApiController] 14 | public class ColorsController : ControllerBase 15 | { 16 | IColorService _colorService; 17 | 18 | public ColorsController(IColorService colorService) 19 | { 20 | _colorService = colorService; 21 | } 22 | [HttpPost("add")] 23 | public IActionResult Add(Color color) 24 | { 25 | var result = _colorService.Add(color); 26 | if (result.Success == true) 27 | { 28 | return Ok(result); 29 | } 30 | return BadRequest(result); 31 | } 32 | 33 | [HttpPost("update")] 34 | public IActionResult Update(Color color) 35 | { 36 | var result = _colorService.Update(color); 37 | if (result.Success == true) 38 | { 39 | return Ok(result); 40 | } 41 | return BadRequest(result); 42 | 43 | } 44 | 45 | [HttpPost("delete")] 46 | public IActionResult Delete(Color color) 47 | { 48 | var result = _colorService.Delete(color); 49 | if (result.Success == true) 50 | { 51 | return Ok(result); 52 | } 53 | return BadRequest(result); 54 | } 55 | 56 | [HttpGet("getbyid")] 57 | public IActionResult GetById(int id) 58 | { 59 | var result = _colorService.GetById(id); 60 | if (result.Success == true) 61 | { 62 | return Ok(result); 63 | } 64 | return BadRequest(result); 65 | } 66 | 67 | [HttpGet("getall")] 68 | public IActionResult GetAll() 69 | { 70 | var result = _colorService.GetAll(); 71 | if (result.Success == true) 72 | { 73 | return Ok(result); 74 | } 75 | return BadRequest(result); 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /WebAPI/Controllers/CrediCardsController.cs: -------------------------------------------------------------------------------- 1 | using Business.Abstract; 2 | using Entities.Concrete; 3 | using Microsoft.AspNetCore.Http; 4 | using Microsoft.AspNetCore.Mvc; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Threading.Tasks; 9 | 10 | namespace WebAPI.Controllers 11 | { 12 | [Route("api/[controller]")] 13 | [ApiController] 14 | public class CrediCardsController : ControllerBase 15 | { 16 | ICreditCardService _creditCardService; 17 | 18 | public CrediCardsController(ICreditCardService creditCardService) 19 | { 20 | _creditCardService = creditCardService; 21 | } 22 | 23 | [HttpPost("add")] 24 | public IActionResult Add(CreditCard credCard) 25 | { 26 | var result = _creditCardService.Add(credCard); 27 | if (result.Success == true) 28 | { 29 | return Ok(result); 30 | } 31 | return BadRequest(result); 32 | } 33 | 34 | [HttpPost("update")] 35 | public IActionResult Update(CreditCard credCard) 36 | { 37 | var result = _creditCardService.Update(credCard); 38 | if (result.Success == true) 39 | { 40 | return Ok(result); 41 | } 42 | return BadRequest(result); 43 | 44 | } 45 | 46 | [HttpPost("delete")] 47 | public IActionResult Delete(CreditCard credCard) 48 | { 49 | var result = _creditCardService.Delete(credCard); 50 | if (result.Success == true) 51 | { 52 | return Ok(result); 53 | } 54 | return BadRequest(result); 55 | } 56 | 57 | [HttpGet("getbyid")] 58 | public IActionResult GetById(int id) 59 | { 60 | var result = _creditCardService.GetById(id); 61 | if (result.Success == true) 62 | { 63 | return Ok(result); 64 | } 65 | return BadRequest(result); 66 | } 67 | [HttpGet("getbyuserid")] 68 | public IActionResult GetByUserId(int userId) 69 | { 70 | var result = _creditCardService.GetById(userId); 71 | if (result.Success == true) 72 | { 73 | return Ok(result); 74 | } 75 | return BadRequest(result); 76 | } 77 | 78 | [HttpGet("getall")] 79 | public IActionResult GetAll() 80 | { 81 | var result = _creditCardService.GetAll(); 82 | if (result.Success == true) 83 | { 84 | return Ok(result); 85 | } 86 | return BadRequest(result); 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /WebAPI/Controllers/CustomersController.cs: -------------------------------------------------------------------------------- 1 | using Business.Abstract; 2 | using Entities.Concrete; 3 | using Microsoft.AspNetCore.Http; 4 | using Microsoft.AspNetCore.Mvc; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Threading.Tasks; 9 | 10 | namespace WebAPI.Controllers 11 | { 12 | [Route("api/[controller]")] 13 | [ApiController] 14 | public class CustomersController : ControllerBase 15 | { 16 | ICustomerService _customerService; 17 | 18 | public CustomersController(ICustomerService customerService) 19 | { 20 | _customerService = customerService; 21 | } 22 | 23 | [HttpPost("add")] 24 | public IActionResult Add(Customer customer) 25 | { 26 | var result = _customerService.Add(customer); 27 | if (result.Success == true) 28 | { 29 | return Ok(result); 30 | } 31 | return BadRequest(result); 32 | } 33 | 34 | [HttpPost("update")] 35 | public IActionResult Update(Customer customer) 36 | { 37 | var result = _customerService.Update(customer); 38 | if (result.Success == true) 39 | { 40 | return Ok(result); 41 | } 42 | return BadRequest(result); 43 | 44 | } 45 | 46 | [HttpPost("delete")] 47 | public IActionResult Delete(Customer customer) 48 | { 49 | var result = _customerService.Delete(customer); 50 | if (result.Success == true) 51 | { 52 | return Ok(result); 53 | } 54 | return BadRequest(result); 55 | } 56 | 57 | [HttpGet("getbyid")] 58 | public IActionResult GetById(int id) 59 | { 60 | var result = _customerService.GetById(id); 61 | if (result.Success == true) 62 | { 63 | return Ok(result); 64 | } 65 | return BadRequest(result); 66 | } 67 | 68 | [HttpGet("getall")] 69 | public IActionResult GetAll() 70 | { 71 | var result = _customerService.GetAll(); 72 | if (result.Success == true) 73 | { 74 | return Ok(result); 75 | } 76 | return BadRequest(result); 77 | } 78 | [HttpGet("getcustomerdetails")] 79 | public IActionResult GetCustomerDetails() 80 | { 81 | var result = _customerService.GetCustomerDetails(); 82 | if (result.Success == true) 83 | { 84 | return Ok(result); 85 | } 86 | return BadRequest(result); 87 | } 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /WebAPI/Controllers/FindeksController.cs: -------------------------------------------------------------------------------- 1 | using Business.Abstract; 2 | using Entities.Concrete; 3 | using Microsoft.AspNetCore.Http; 4 | using Microsoft.AspNetCore.Mvc; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Threading.Tasks; 9 | 10 | namespace WebAPI.Controllers 11 | { 12 | [Route("api/[controller]")] 13 | [ApiController] 14 | public class FindeksController : ControllerBase 15 | { 16 | IFindexService _findexService; 17 | 18 | public FindeksController(IFindexService findexService) 19 | { 20 | _findexService = findexService; 21 | } 22 | 23 | [HttpPost("add")] 24 | public IActionResult Add(Findex findexDto) 25 | { 26 | var result = _findexService.Add(findexDto); 27 | if (result.Success == true) 28 | { 29 | return Ok(result); 30 | } 31 | return BadRequest(result); 32 | } 33 | 34 | [HttpPost("update")] 35 | public IActionResult Update(Findex findexDto) 36 | { 37 | var result = _findexService.Update(findexDto); 38 | if (result.Success == true) 39 | { 40 | return Ok(result); 41 | } 42 | return BadRequest(result); 43 | 44 | } 45 | 46 | [HttpPost("delete")] 47 | public IActionResult Delete(Findex findexDto) 48 | { 49 | var result = _findexService.Delete(findexDto); 50 | if (result.Success == true) 51 | { 52 | return Ok(result); 53 | } 54 | return BadRequest(result); 55 | } 56 | 57 | [HttpGet("getbyid")] 58 | public IActionResult GetById(int id) 59 | { 60 | var result = _findexService.GetById(id); 61 | if (result.Success == true) 62 | { 63 | return Ok(result); 64 | } 65 | return BadRequest(result); 66 | } 67 | [HttpGet("getuserfindex")] 68 | public IActionResult GetUserFindex() 69 | { 70 | var result = _findexService.GetUserFindex(); 71 | if (result.Success == true) 72 | { 73 | return Ok(result); 74 | } 75 | return BadRequest(result); 76 | } 77 | [HttpGet("getcarfindex")] 78 | public IActionResult GetCarFindex() 79 | { 80 | var result = _findexService.GetCarFindex(); 81 | if (result.Success == true) 82 | { 83 | return Ok(result); 84 | } 85 | return BadRequest(result); 86 | } 87 | [HttpGet("getall")] 88 | public IActionResult GetAll() 89 | { 90 | var result = _findexService.GetAll(); 91 | if (result.Success == true) 92 | { 93 | return Ok(result); 94 | } 95 | return BadRequest(result); 96 | } 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /WebAPI/Controllers/PaymentsController.cs: -------------------------------------------------------------------------------- 1 | using Business.Abstract; 2 | using Entities.Concrete; 3 | using Microsoft.AspNetCore.Http; 4 | using Microsoft.AspNetCore.Mvc; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Threading.Tasks; 9 | 10 | namespace WebAPI.Controllers 11 | { 12 | [Route("api/[controller]")] 13 | [ApiController] 14 | public class PaymentsController : ControllerBase 15 | { 16 | IPaymentService _paymentService; 17 | 18 | public PaymentsController(IPaymentService paymentService) 19 | { 20 | _paymentService = paymentService; 21 | } 22 | 23 | [HttpPost("add")] 24 | public IActionResult Add(Payment payment) 25 | { 26 | var result = _paymentService.Add(payment); 27 | if (result.Success == true) 28 | { 29 | return Ok(result); 30 | } 31 | return BadRequest(result); 32 | } 33 | 34 | [HttpPost("update")] 35 | public IActionResult Update(Payment payment) 36 | { 37 | var result = _paymentService.Update(payment); 38 | if (result.Success == true) 39 | { 40 | return Ok(result); 41 | } 42 | return BadRequest(result); 43 | 44 | } 45 | 46 | [HttpPost("delete")] 47 | public IActionResult Delete(Payment payment) 48 | { 49 | var result = _paymentService.Delete(payment); 50 | if (result.Success == true) 51 | { 52 | return Ok(result); 53 | } 54 | return BadRequest(result); 55 | } 56 | 57 | [HttpGet("getbyid")] 58 | public IActionResult GetById(int id) 59 | { 60 | var result = _paymentService.GetById(id); 61 | if (result.Success == true) 62 | { 63 | return Ok(result); 64 | } 65 | return BadRequest(result); 66 | } 67 | 68 | [HttpGet("getall")] 69 | public IActionResult GetAll() 70 | { 71 | var result = _paymentService.GetAll(); 72 | if (result.Success == true) 73 | { 74 | return Ok(result); 75 | } 76 | return BadRequest(result); 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /WebAPI/Controllers/RentalsController.cs: -------------------------------------------------------------------------------- 1 | using Business.Abstract; 2 | using Entities.Concrete; 3 | using Microsoft.AspNetCore.Http; 4 | using Microsoft.AspNetCore.Mvc; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Threading.Tasks; 9 | 10 | namespace WebAPI.Controllers 11 | { 12 | [Route("api/[controller]")] 13 | [ApiController] 14 | public class RentalsController : ControllerBase 15 | { 16 | IRentalService _rentalService; 17 | 18 | public RentalsController(IRentalService rentalService) 19 | { 20 | _rentalService = rentalService; 21 | } 22 | 23 | [HttpPost("add")] 24 | public IActionResult Add(Rental rental) 25 | { 26 | var result = _rentalService.Add(rental); 27 | if (result.Success) 28 | { 29 | return Ok(result); 30 | } 31 | return BadRequest(result); 32 | } 33 | 34 | [HttpPost("update")] 35 | public IActionResult Update(Rental rental) 36 | { 37 | var result = _rentalService.Update(rental); 38 | if (result.Success) 39 | { 40 | return Ok(result); 41 | } 42 | return BadRequest(result); 43 | } 44 | 45 | [HttpPost("delete")] 46 | public IActionResult Delete(Rental rental) 47 | { 48 | var result = _rentalService.Delete(rental); 49 | if (result.Success) 50 | { 51 | return Ok(result); 52 | } 53 | return BadRequest(result); 54 | } 55 | 56 | [HttpGet("getbyid")] 57 | public IActionResult GetById(int id) 58 | { 59 | var result = _rentalService.GetById(id); 60 | if (result.Success) 61 | { 62 | return Ok(result); 63 | } 64 | return BadRequest(result); 65 | } 66 | 67 | [HttpGet("getall")] 68 | public IActionResult GetAll() 69 | { 70 | var result = _rentalService.GetAll(); 71 | if (result.Success) 72 | { 73 | return Ok(result); 74 | } 75 | return BadRequest(result); 76 | } 77 | 78 | [HttpGet("isforrent")] 79 | public IActionResult IsForRent(int carId) 80 | { 81 | var result = _rentalService.IsForRent(carId); 82 | if (result.Success) 83 | { 84 | return Ok(result); 85 | } 86 | return BadRequest(result); 87 | } 88 | [HttpPost("isforrentcompany")] 89 | public IActionResult IsForRentCompany(Rental rental) 90 | { 91 | var result = _rentalService.IsForRentCompany(rental); 92 | if (result.Success) 93 | { 94 | return Ok(result); 95 | } 96 | return BadRequest(result); 97 | } 98 | [HttpGet("isrentedbycarId")] 99 | public IActionResult IsRentedByCarId(int carId) 100 | { 101 | var result = _rentalService.IsRentedByCarId(carId); 102 | if (result.Success) 103 | { 104 | return Ok(result); 105 | } 106 | return BadRequest(result); 107 | } 108 | [HttpGet("getallrentaldetails")] 109 | public IActionResult GetAllRentalDetails() 110 | { 111 | var result = _rentalService.GetAllRentalDetails(); 112 | if (result.Success) 113 | { 114 | return Ok(result); 115 | } 116 | return BadRequest(result); 117 | } 118 | [HttpGet("getrentaldetailsbycarId")] 119 | public IActionResult GetRentalDetailsByCarId(int carId) 120 | { 121 | var result = _rentalService.GetRentalDetailsByCarId(carId); 122 | if (result.Success) 123 | { 124 | return Ok(result); 125 | } 126 | return BadRequest(result); 127 | } 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /WebAPI/Controllers/UsersController.cs: -------------------------------------------------------------------------------- 1 | using Business.Abstract; 2 | using Core.Entities.Concrete; 3 | using Entities.Concrete; 4 | using Microsoft.AspNetCore.Http; 5 | using Microsoft.AspNetCore.Mvc; 6 | using System; 7 | using System.Collections.Generic; 8 | using System.Linq; 9 | using System.Threading.Tasks; 10 | 11 | namespace WebAPI.Controllers 12 | { 13 | [Route("api/[controller]")] 14 | [ApiController] 15 | public class UsersController : ControllerBase 16 | { 17 | IUserService _userService; 18 | 19 | public UsersController(IUserService userService) 20 | { 21 | _userService = userService; 22 | } 23 | 24 | [HttpPost("add")] 25 | public IActionResult Add(User user) 26 | { 27 | var result = _userService.Add(user); 28 | if (result.Success) 29 | { 30 | return Ok(result); 31 | } 32 | return BadRequest(result); 33 | } 34 | 35 | [HttpPost("update")] 36 | public IActionResult Update(User user) 37 | { 38 | var result = _userService.Update(user); 39 | if (result.Success) 40 | { 41 | return Ok(result); 42 | } 43 | return BadRequest(result); 44 | } 45 | 46 | [HttpPost("delete")] 47 | public IActionResult Delete(User user) 48 | { 49 | var result = _userService.Delete(user); 50 | if (result.Success) 51 | { 52 | return Ok(result); 53 | } 54 | return BadRequest(result); 55 | } 56 | 57 | [HttpGet("getbyid")] 58 | public IActionResult GetById(int id) { 59 | var result = _userService.GetById(id); 60 | if (result.Success) 61 | { 62 | return Ok(result); 63 | } 64 | return BadRequest(result); 65 | } 66 | 67 | [HttpGet("getall")] 68 | public IActionResult GetAll() 69 | { 70 | var result = _userService.GetAll(); 71 | if (result.Success) 72 | { 73 | return Ok(result); 74 | } 75 | return BadRequest(result); 76 | } 77 | 78 | [HttpGet("getuserdetails")] 79 | public IActionResult GetUserDetails() { 80 | var result = _userService.GetUserDetails(); 81 | if (result.Success) 82 | { 83 | return Ok(result); 84 | } 85 | return BadRequest(result); 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /WebAPI/Program.cs: -------------------------------------------------------------------------------- 1 | using Autofac; 2 | using Autofac.Extensions.DependencyInjection; 3 | using Business.DependencyResolvers.AutoFac; 4 | using Microsoft.AspNetCore.Hosting; 5 | using Microsoft.Extensions.Configuration; 6 | using Microsoft.Extensions.Hosting; 7 | using Microsoft.Extensions.Logging; 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Linq; 11 | using System.Threading.Tasks; 12 | 13 | namespace WebAPI 14 | { 15 | public class Program 16 | { 17 | public static void Main(string[] args) 18 | { 19 | CreateHostBuilder(args).Build().Run(); 20 | } 21 | public static IHostBuilder CreateHostBuilder(string[] args) => 22 | Host.CreateDefaultBuilder(args) 23 | .UseServiceProviderFactory(new AutofacServiceProviderFactory()) 24 | .ConfigureContainer(builder => 25 | { 26 | 27 | builder.RegisterModule(new AutofacBusinessModule()); 28 | 29 | }) 30 | .ConfigureWebHostDefaults(webBuilder => 31 | { 32 | webBuilder.UseStartup(); 33 | }); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /WebAPI/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:26305", 8 | "sslPort": 44356 9 | } 10 | }, 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": false, 15 | "launchUrl": "api", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "WebAPI": { 21 | "commandName": "Project", 22 | "launchBrowser": false, 23 | "launchUrl": "api", 24 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 25 | "environmentVariables": { 26 | "ASPNETCORE_ENVIRONMENT": "Development" 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /WebAPI/Startup.cs: -------------------------------------------------------------------------------- 1 | using Core.DependencyResolvers.Autofac; 2 | using Core.Extensions; 3 | using Core.Utilities.IoC; 4 | using Core.Utilities.Security.Encryption; 5 | using Core.Utilities.Security.Jwt; 6 | using Microsoft.AspNetCore.Authentication.JwtBearer; 7 | using Microsoft.AspNetCore.Builder; 8 | using Microsoft.AspNetCore.Hosting; 9 | using Microsoft.AspNetCore.Http; 10 | using Microsoft.Extensions.Configuration; 11 | using Microsoft.Extensions.DependencyInjection; 12 | using Microsoft.Extensions.FileProviders; 13 | using Microsoft.Extensions.Hosting; 14 | using Microsoft.IdentityModel.Tokens; 15 | using Microsoft.OpenApi.Models; 16 | using System.IO; 17 | 18 | namespace WebAPI 19 | { 20 | public class Startup 21 | { 22 | public Startup(IConfiguration configuration) 23 | { 24 | Configuration = configuration; 25 | } 26 | 27 | public IConfiguration Configuration { get; } 28 | 29 | // This method gets called by the runtime. Use this method to add services to the container. 30 | public void ConfigureServices(IServiceCollection services) 31 | { 32 | services.AddControllers(); 33 | services.AddSwaggerGen(c => 34 | { 35 | c.SwaggerDoc("v1", new OpenApiInfo { Title = "Sample API", Version = "version 1" }); 36 | }); 37 | //services.AddSingleton(); 38 | //services.AddSingleton(); 39 | //// 40 | //services.AddSingleton(); 41 | //services.AddSingleton(); 42 | //// 43 | //services.AddSingleton(); 44 | //services.AddSingleton(); 45 | 46 | services.AddCors(); 47 | 48 | var tokenOptions = Configuration.GetSection("TokenOptions").Get(); 49 | 50 | services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) 51 | .AddJwtBearer(options => 52 | { 53 | options.TokenValidationParameters = new TokenValidationParameters 54 | { 55 | ValidateIssuer = true, 56 | ValidateAudience = true, 57 | ValidateLifetime = true, 58 | ValidIssuer = tokenOptions.Issuer, 59 | ValidAudience = tokenOptions.Audience, 60 | ValidateIssuerSigningKey = true, 61 | IssuerSigningKey = SecurityKeyHelper.CreateSecurityKey(tokenOptions.SecurityKey) 62 | }; 63 | }); 64 | services.AddDependencyResolvers(new ICoreModule[] { new CoreModule() }); 65 | 66 | } 67 | 68 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 69 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 70 | { 71 | if (env.IsDevelopment()) 72 | { 73 | app.UseDeveloperExceptionPage(); 74 | 75 | app.UseSwagger(); 76 | 77 | app.UseSwaggerUI(c => 78 | { 79 | c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1"); 80 | }); 81 | 82 | } 83 | else 84 | { 85 | app.UseExceptionHandler("/Home/Error"); 86 | app.UseHsts(); 87 | } 88 | app.UseCors(builder => builder.WithOrigins("http://localhost:4200").AllowAnyHeader()); 89 | 90 | app.UseHttpsRedirection(); 91 | 92 | app.UseStaticFiles(new StaticFileOptions 93 | { 94 | FileProvider = new PhysicalFileProvider( 95 | Path.Combine(env.ContentRootPath, "wwwroot")), 96 | RequestPath = "/Temp" 97 | }); 98 | 99 | app.UseRouting(); 100 | app.UseAuthentication(); 101 | app.UseAuthorization(); 102 | 103 | 104 | app.UseEndpoints(endpoints => 105 | { 106 | endpoints.MapControllers(); 107 | }); 108 | } 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /WebAPI/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace WebAPI 4 | { 5 | public class WeatherForecast 6 | { 7 | public DateTime Date { get; set; } 8 | 9 | public int TemperatureC { get; set; } 10 | 11 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 12 | 13 | public string Summary { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /WebAPI/WebAPI.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /WebAPI/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /WebAPI/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "TokenOptions": { 3 | "Audience": "abc@def.com", 4 | "Issuer": "abc@def.com", 5 | "AccessTokenExpiration": 10, 6 | "SecurityKey": "qwertyuilkjhsgqwertyuilkjhsg" 7 | }, 8 | "Logging": { 9 | "LogLevel": { 10 | "Default": "Information", 11 | "Microsoft": "Warning", 12 | "Microsoft.Hosting.Lifetime": "Information" 13 | } 14 | }, 15 | "AllowedHosts": "*", 16 | "oldPath": { 17 | "CarImages": "", 18 | "UserImages": "" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /WebAPI/wwwroot/Temp/06cadb47-2e26-47a5-beea-140094296a78.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/WebAPI/wwwroot/Temp/06cadb47-2e26-47a5-beea-140094296a78.jpg -------------------------------------------------------------------------------- /WebAPI/wwwroot/Temp/10a7e68c-d0fe-4318-bbac-ebe3cc6cdfee.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/WebAPI/wwwroot/Temp/10a7e68c-d0fe-4318-bbac-ebe3cc6cdfee.jpg -------------------------------------------------------------------------------- /WebAPI/wwwroot/Temp/1b07e30e-a48d-43d8-a63e-473bf46020c4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/WebAPI/wwwroot/Temp/1b07e30e-a48d-43d8-a63e-473bf46020c4.jpg -------------------------------------------------------------------------------- /WebAPI/wwwroot/Temp/1f2cd81e-d0bd-4f59-94a2-070dd6f5ae2d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/WebAPI/wwwroot/Temp/1f2cd81e-d0bd-4f59-94a2-070dd6f5ae2d.jpg -------------------------------------------------------------------------------- /WebAPI/wwwroot/Temp/20a8c9f1-4291-469d-966d-4cb17cdf7fa8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/WebAPI/wwwroot/Temp/20a8c9f1-4291-469d-966d-4cb17cdf7fa8.png -------------------------------------------------------------------------------- /WebAPI/wwwroot/Temp/22958191-3702-489f-822b-c5bff11dfa51.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/WebAPI/wwwroot/Temp/22958191-3702-489f-822b-c5bff11dfa51.jpg -------------------------------------------------------------------------------- /WebAPI/wwwroot/Temp/26c46d24-ccf0-4ccb-bcf6-a2b661d181b8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/WebAPI/wwwroot/Temp/26c46d24-ccf0-4ccb-bcf6-a2b661d181b8.jpg -------------------------------------------------------------------------------- /WebAPI/wwwroot/Temp/284f32ca-a7e8-4bdb-b4e3-4b5692b61711.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/WebAPI/wwwroot/Temp/284f32ca-a7e8-4bdb-b4e3-4b5692b61711.jpg -------------------------------------------------------------------------------- /WebAPI/wwwroot/Temp/3a96b150-b5b7-4f04-8669-f86d8e380c80.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/WebAPI/wwwroot/Temp/3a96b150-b5b7-4f04-8669-f86d8e380c80.jpg -------------------------------------------------------------------------------- /WebAPI/wwwroot/Temp/40fcd418-fe6a-4a04-9bdc-23beee2edf56.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/WebAPI/wwwroot/Temp/40fcd418-fe6a-4a04-9bdc-23beee2edf56.jpg -------------------------------------------------------------------------------- /WebAPI/wwwroot/Temp/4eaca2e1-852a-4c98-aa31-afc185d8733c.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/WebAPI/wwwroot/Temp/4eaca2e1-852a-4c98-aa31-afc185d8733c.jpg -------------------------------------------------------------------------------- /WebAPI/wwwroot/Temp/51219c8e-6e05-40e3-b6e8-413285158a54.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/WebAPI/wwwroot/Temp/51219c8e-6e05-40e3-b6e8-413285158a54.jpg -------------------------------------------------------------------------------- /WebAPI/wwwroot/Temp/61092f87-7d71-4f2d-bcef-8d0835c48916.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/WebAPI/wwwroot/Temp/61092f87-7d71-4f2d-bcef-8d0835c48916.jpg -------------------------------------------------------------------------------- /WebAPI/wwwroot/Temp/69009443-068e-4945-b4b6-4b3cd9116651.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/WebAPI/wwwroot/Temp/69009443-068e-4945-b4b6-4b3cd9116651.jpg -------------------------------------------------------------------------------- /WebAPI/wwwroot/Temp/6aab46a6-d98a-4714-975c-b575f077d8c1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/WebAPI/wwwroot/Temp/6aab46a6-d98a-4714-975c-b575f077d8c1.jpg -------------------------------------------------------------------------------- /WebAPI/wwwroot/Temp/6bea425f-428c-480e-93a6-76551abfe22b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/WebAPI/wwwroot/Temp/6bea425f-428c-480e-93a6-76551abfe22b.jpg -------------------------------------------------------------------------------- /WebAPI/wwwroot/Temp/8e6d33c5-a867-478c-b393-ecf22123d3bf.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/WebAPI/wwwroot/Temp/8e6d33c5-a867-478c-b393-ecf22123d3bf.jpg -------------------------------------------------------------------------------- /WebAPI/wwwroot/Temp/96857e74-8f60-4a76-995f-5c54867e86dc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/WebAPI/wwwroot/Temp/96857e74-8f60-4a76-995f-5c54867e86dc.jpg -------------------------------------------------------------------------------- /WebAPI/wwwroot/Temp/RentACarImageDefault.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/WebAPI/wwwroot/Temp/RentACarImageDefault.jpg -------------------------------------------------------------------------------- /WebAPI/wwwroot/Temp/b11b2eca-ed36-41c4-bc8c-1beeef84a211.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/WebAPI/wwwroot/Temp/b11b2eca-ed36-41c4-bc8c-1beeef84a211.jpg -------------------------------------------------------------------------------- /WebAPI/wwwroot/Temp/c0b96b83-e12e-4aef-a8d8-136ee2a34564.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/WebAPI/wwwroot/Temp/c0b96b83-e12e-4aef-a8d8-136ee2a34564.png -------------------------------------------------------------------------------- /WebAPI/wwwroot/Temp/c1894752-de9e-4005-bdfe-336390ae6626.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/WebAPI/wwwroot/Temp/c1894752-de9e-4005-bdfe-336390ae6626.jpg -------------------------------------------------------------------------------- /WebAPI/wwwroot/Temp/c53a7219-aec8-4f66-ac0d-5a1bcae6b61d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/WebAPI/wwwroot/Temp/c53a7219-aec8-4f66-ac0d-5a1bcae6b61d.jpg -------------------------------------------------------------------------------- /WebAPI/wwwroot/Temp/c8270866-2699-4f08-b3d4-c96f3632e375.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/WebAPI/wwwroot/Temp/c8270866-2699-4f08-b3d4-c96f3632e375.jpg -------------------------------------------------------------------------------- /WebAPI/wwwroot/Temp/c9b2a485-2c6e-409b-b30c-cd599ebb08c7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/WebAPI/wwwroot/Temp/c9b2a485-2c6e-409b-b30c-cd599ebb08c7.jpg -------------------------------------------------------------------------------- /WebAPI/wwwroot/Temp/e4a05474-f6ca-4edb-a34c-707ed6833d2b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/WebAPI/wwwroot/Temp/e4a05474-f6ca-4edb-a34c-707ed6833d2b.jpg -------------------------------------------------------------------------------- /WebAPI/wwwroot/Temp/f37e128a-ceb2-49b7-8518-8245cd5ce6d7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/WebAPI/wwwroot/Temp/f37e128a-ceb2-49b7-8518-8245cd5ce6d7.jpg -------------------------------------------------------------------------------- /WebAPI/wwwroot/Temp/f51f4a58-af0c-4c54-afea-852e67aff658.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/WebAPI/wwwroot/Temp/f51f4a58-af0c-4c54-afea-852e67aff658.jpg -------------------------------------------------------------------------------- /WebAPI/wwwroot/Temp/f9625188-e9f6-4266-b364-410719041336.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/WebAPI/wwwroot/Temp/f9625188-e9f6-4266-b364-410719041336.jpg -------------------------------------------------------------------------------- /WebAPI/wwwroot/Temp/fd502c3d-beaa-4673-a915-24f47b2dbbab.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enesozmert/ReCapProject/c93901e4d10f339a394396532c4a003c4e4ec13e/WebAPI/wwwroot/Temp/fd502c3d-beaa-4673-a915-24f47b2dbbab.jpg --------------------------------------------------------------------------------