├── .vscode ├── launch.json └── tasks.json ├── APIFuelStation.csproj ├── CommandBus ├── CommandHandlers │ ├── Auth │ │ ├── AuthCommandHandler.cs │ │ └── UserRegisterCommandHandler.cs │ ├── Department │ │ ├── CreateDepartmentHandler.cs │ │ ├── DeleteDepartmentHandler.cs │ │ └── UpdateDepartmentHandler.cs │ ├── Designation │ │ ├── CreateDesignationHandler.cs │ │ ├── DeleteDesignationHandler.cs │ │ └── UpdateDesignationHandler.cs │ ├── Employee │ │ ├── CreateEmployeeHandler.cs │ │ ├── DeleteEmployeeHandler.cs │ │ └── UpdateEmployeeHandler.cs │ └── User │ │ ├── CreateUserHandler.cs │ │ ├── DeleteUserHandler.cs │ │ └── UpdateUserHandler.cs └── Commands │ ├── Auth │ ├── UserAuthCommand.cs │ └── UserRegisterCommand.cs │ ├── Department │ ├── CreateDepartmentCommand.cs │ ├── DeleteDepartmentCommand.cs │ └── UpdateDepartmentCommand.cs │ ├── Designation │ ├── CreateDesignationCommand.cs │ ├── DeleteDesignationCommand.cs │ └── UpdateDesignationCommand.cs │ ├── Employee │ ├── CreateEmployeeCommand.cs │ ├── DeleteEmployeeCommand.cs │ └── UpdateEmployeeCommand.cs │ └── User │ ├── CreateUserCommand.cs │ ├── DeleteUserCommand.cs │ └── UpdateUserCommand.cs ├── Controllers ├── AuthController.cs ├── DepartmentsController.cs ├── DesignationsController.cs ├── DummyControllerExample.cs ├── EmployeesController.cs ├── UsersController.cs └── WeatherForecastController.cs ├── DbContexts └── FuelDBContext.cs ├── IRepositories ├── IAuthRepository.cs ├── IDepartmentRepository.cs ├── IDesignationRepository.cs ├── IEmployeeRepository.cs └── IUserRepository.cs ├── Migrations ├── 20200619131033_UserTableMigration.Designer.cs ├── 20200619131033_UserTableMigration.cs ├── 20200620044643_UniqueEmail.Designer.cs ├── 20200620044643_UniqueEmail.cs ├── 20200620045532_UniquePhoneUsername.Designer.cs ├── 20200620045532_UniquePhoneUsername.cs ├── 20200620070410_DepartmentDesignationMigration.Designer.cs ├── 20200620070410_DepartmentDesignationMigration.cs ├── 20200623152632_EmployeeMigration.Designer.cs ├── 20200623152632_EmployeeMigration.cs └── FuelDBContextModelSnapshot.cs ├── Models ├── Department.cs ├── Designation.cs ├── Employee.cs └── User.cs ├── ModelsValidator ├── DepartmentValidator.cs ├── DesignationValidator.cs ├── EmployeeValidator.cs └── UserValidator.cs ├── Program.cs ├── Properties └── launchSettings.json ├── QueryBus ├── Queries │ ├── Department │ │ ├── GetAllDepartmentQuery.cs │ │ └── GetSingleDepartmentQuery.cs │ ├── Designation │ │ ├── GetAllDesignationQuery.cs │ │ └── GetSingleDesignationQuery.cs │ ├── Employee │ │ ├── GetAllEmployeeQuery.cs │ │ └── GetSingleEmployeeQuery.cs │ └── User │ │ ├── GetAllUserQuery.cs │ │ └── GetSingleUserQuery.cs └── QueryHandlers │ ├── Department │ ├── GetAllDepartmentHandler.cs │ └── GetSingleDepartmentHandler.cs │ ├── Designation │ ├── GetAllDesignationHandler.cs │ └── GetSingleDesignationHandler.cs │ ├── Employee │ ├── GetAllEmployeeHandler.cs │ └── GetSingleEmployeeHandler.cs │ └── User │ ├── GetAllUserHandler.cs │ └── GetSingleUserHandler.cs ├── README.md ├── Repositories ├── DepartmentRepository.cs ├── DesignationRepository.cs ├── EmployeeRepository.cs └── UserRepository.cs ├── Startup.cs ├── ViewModel └── TokenViewModel.cs ├── WeatherForecast.cs ├── appsettings.Development.json ├── appsettings.json ├── bin └── Debug │ └── netcoreapp3.1 │ ├── APIFuelStation.deps.json │ ├── APIFuelStation.dll │ ├── APIFuelStation.exe │ ├── APIFuelStation.pdb │ ├── APIFuelStation.runtimeconfig.dev.json │ ├── APIFuelStation.runtimeconfig.json │ ├── APIFuelStation.xml │ ├── AutoMapper.Extensions.Microsoft.DependencyInjection.dll │ ├── AutoMapper.dll │ ├── BCrypt.Net-Next.dll │ ├── FluentValidation.AspNetCore.dll │ ├── FluentValidation.DependencyInjectionExtensions.dll │ ├── FluentValidation.dll │ ├── MediatR.Extensions.Microsoft.DependencyInjection.dll │ ├── MediatR.dll │ ├── Microsoft.AspNetCore.Authentication.JwtBearer.dll │ ├── Microsoft.AspNetCore.JsonPatch.dll │ ├── Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll │ ├── Microsoft.Bcl.AsyncInterfaces.dll │ ├── Microsoft.Bcl.HashCode.dll │ ├── Microsoft.Data.SqlClient.dll │ ├── Microsoft.EntityFrameworkCore.Abstractions.dll │ ├── Microsoft.EntityFrameworkCore.Design.dll │ ├── Microsoft.EntityFrameworkCore.Relational.dll │ ├── Microsoft.EntityFrameworkCore.SqlServer.dll │ ├── Microsoft.EntityFrameworkCore.dll │ ├── Microsoft.Extensions.Caching.Abstractions.dll │ ├── Microsoft.Extensions.Caching.Memory.dll │ ├── Microsoft.Extensions.Configuration.Abstractions.dll │ ├── Microsoft.Extensions.Configuration.Binder.dll │ ├── Microsoft.Extensions.Configuration.dll │ ├── Microsoft.Extensions.DependencyInjection.Abstractions.dll │ ├── Microsoft.Extensions.DependencyInjection.dll │ ├── Microsoft.Extensions.Logging.Abstractions.dll │ ├── Microsoft.Extensions.Logging.dll │ ├── Microsoft.Extensions.Options.dll │ ├── Microsoft.Extensions.Primitives.dll │ ├── Microsoft.Identity.Client.dll │ ├── Microsoft.IdentityModel.JsonWebTokens.dll │ ├── Microsoft.IdentityModel.Logging.dll │ ├── Microsoft.IdentityModel.Protocols.OpenIdConnect.dll │ ├── Microsoft.IdentityModel.Protocols.dll │ ├── Microsoft.IdentityModel.Tokens.dll │ ├── Microsoft.OpenApi.dll │ ├── Newtonsoft.Json.Bson.dll │ ├── Newtonsoft.Json.dll │ ├── Properties │ └── launchSettings.json │ ├── Swashbuckle.AspNetCore.Swagger.dll │ ├── Swashbuckle.AspNetCore.SwaggerGen.dll │ ├── Swashbuckle.AspNetCore.SwaggerUI.dll │ ├── System.Collections.Immutable.dll │ ├── System.Configuration.ConfigurationManager.dll │ ├── System.Diagnostics.DiagnosticSource.dll │ ├── System.IdentityModel.Tokens.Jwt.dll │ ├── System.Runtime.Caching.dll │ ├── System.Security.Cryptography.ProtectedData.dll │ ├── appsettings.Development.json │ ├── appsettings.json │ └── runtimes │ ├── unix │ └── lib │ │ ├── netcoreapp2.0 │ │ └── System.Runtime.Caching.dll │ │ └── netcoreapp2.1 │ │ └── Microsoft.Data.SqlClient.dll │ ├── win-arm64 │ └── native │ │ └── sni.dll │ ├── win-x64 │ └── native │ │ └── sni.dll │ ├── win-x86 │ └── native │ │ └── sni.dll │ └── win │ └── lib │ ├── netcoreapp2.0 │ └── System.Runtime.Caching.dll │ ├── netcoreapp2.1 │ └── Microsoft.Data.SqlClient.dll │ └── netstandard2.0 │ └── System.Security.Cryptography.ProtectedData.dll └── obj ├── APIFuelStation.csproj.EntityFrameworkCore.targets ├── APIFuelStation.csproj.nuget.dgspec.json ├── APIFuelStation.csproj.nuget.g.props ├── APIFuelStation.csproj.nuget.g.targets ├── Debug └── netcoreapp3.1 │ ├── .NETCoreApp,Version=v3.1.AssemblyAttributes.cs │ ├── APIFuelStation.AssemblyInfo.cs │ ├── APIFuelStation.AssemblyInfoInputs.cache │ ├── APIFuelStation.MvcApplicationPartsAssemblyInfo.cache │ ├── APIFuelStation.MvcApplicationPartsAssemblyInfo.cs │ ├── APIFuelStation.RazorTargetAssemblyInfo.cache │ ├── APIFuelStation.assets.cache │ ├── APIFuelStation.csproj.CopyComplete │ ├── APIFuelStation.csproj.CoreCompileInputs.cache │ ├── APIFuelStation.csproj.FileListAbsolute.txt │ ├── APIFuelStation.csprojAssemblyReference.cache │ ├── APIFuelStation.dll │ ├── APIFuelStation.exe │ ├── APIFuelStation.genruntimeconfig.cache │ ├── APIFuelStation.pdb │ ├── APIFuelStation.xml │ ├── project.razor.json │ └── staticwebassets │ ├── APIFuelStation.StaticWebAssets.Manifest.cache │ └── APIFuelStation.StaticWebAssets.xml ├── project.assets.json └── project.nuget.cache /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | 8 | { 9 | "name": ".NET Core Launch (web)", 10 | "type": "coreclr", 11 | "request": "launch", 12 | "preLaunchTask": "build", 13 | "program": "${workspaceFolder}/bin/Debug/netcoreapp3.1/APIFuelStation.dll", 14 | "args": [], 15 | "cwd": "${workspaceFolder}", 16 | "stopAtEntry": false, 17 | "serverReadyAction": { 18 | "action": "openExternally", 19 | "pattern": "\\bNow listening on:\\s+(https?://\\S+)" 20 | }, 21 | "env": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "sourceFileMap": { 25 | "/Views": "${workspaceFolder}/Views" 26 | } 27 | }, 28 | { 29 | "name": ".NET Core Attach", 30 | "type": "coreclr", 31 | "request": "attach", 32 | "processId": "${command:pickProcess}" 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "command": "dotnet", 7 | "type": "process", 8 | "args": [ 9 | "build", 10 | "${workspaceFolder}/APIFuelStation.csproj", 11 | "/property:GenerateFullPaths=true", 12 | "/consoleloggerparameters:NoSummary" 13 | ], 14 | "problemMatcher": "$msCompile" 15 | }, 16 | { 17 | "label": "publish", 18 | "command": "dotnet", 19 | "type": "process", 20 | "args": [ 21 | "publish", 22 | "${workspaceFolder}/APIFuelStation.csproj", 23 | "/property:GenerateFullPaths=true", 24 | "/consoleloggerparameters:NoSummary" 25 | ], 26 | "problemMatcher": "$msCompile" 27 | }, 28 | { 29 | "label": "watch", 30 | "command": "dotnet", 31 | "type": "process", 32 | "args": [ 33 | "watch", 34 | "run", 35 | "${workspaceFolder}/APIFuelStation.csproj", 36 | "/property:GenerateFullPaths=true", 37 | "/consoleloggerparameters:NoSummary" 38 | ], 39 | "problemMatcher": "$msCompile" 40 | } 41 | ] 42 | } -------------------------------------------------------------------------------- /APIFuelStation.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | true 7 | $(NoWarn);1591 8 | enable 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | runtime; build; native; contentfiles; analyzers; buildtransitive 23 | all 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /CommandBus/CommandHandlers/Auth/AuthCommandHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IdentityModel.Tokens.Jwt; 3 | using System.Security.Claims; 4 | using System.Text; 5 | using System.Threading; 6 | using System.Threading.Tasks; 7 | using APIFuelStation.CommandBus.Commands; 8 | using APIFuelStation.IRepositories; 9 | using APIFuelStation.Models; 10 | using APIFuelStation.ViewModel; 11 | using MediatR; 12 | using Microsoft.Extensions.Configuration; 13 | using Microsoft.IdentityModel.Tokens; 14 | 15 | namespace APIFuelStation.CommandBus { 16 | public class AuthCommandHandler : IRequestHandler { 17 | 18 | private readonly IUserRepository _userrepository; 19 | private readonly IConfiguration _configuration; 20 | 21 | public AuthCommandHandler (IUserRepository userrepository, IConfiguration configuration) { 22 | this._userrepository = userrepository; 23 | this._configuration = configuration; 24 | } 25 | public async Task Handle (UserAuthCommand request, CancellationToken cancellationToken) { 26 | var user = _userrepository.GetUserByEmail (request.Email); 27 | var userByUserName = _userrepository.GetUserByUserName (request.Email); 28 | var userByPhoneNo = _userrepository.GetUserByPhoneNo (request.Email); 29 | 30 | if (user != null) { 31 | return GetTokenView (user, request); 32 | } else if (userByUserName != null) { 33 | return GetTokenView (userByUserName, request); 34 | } else if (userByPhoneNo != null) { 35 | return GetTokenView (userByPhoneNo, request); 36 | } 37 | 38 | return new TokenViewModel { Token = null, User = null }; 39 | } 40 | 41 | public TokenViewModel GetTokenView (User user, UserAuthCommand request) { 42 | if (user != null) { 43 | if (BCrypt.Net.BCrypt.Verify (request.Password, user.Password)) { 44 | var tokenStr = GenerateJSONWebToken (user); 45 | var response = new { token = tokenStr, user = user }; 46 | return new TokenViewModel { Token = response.token, User = user }; 47 | } 48 | } 49 | return new TokenViewModel { Token = null, User = null }; 50 | } 51 | 52 | public string GenerateJSONWebToken (User user) { 53 | var securityKey = new SymmetricSecurityKey (Encoding.UTF8.GetBytes (_configuration["Jwt:Key"])); 54 | var credentials = new SigningCredentials (securityKey, SecurityAlgorithms.HmacSha256); 55 | 56 | var claims = new [] { 57 | new Claim (JwtRegisteredClaimNames.Sub, user.UserName), 58 | new Claim (JwtRegisteredClaimNames.Email, user.Email), 59 | new Claim (JwtRegisteredClaimNames.Jti, Guid.NewGuid ().ToString ()) 60 | }; 61 | 62 | var token = new JwtSecurityToken ( 63 | issuer: _configuration["Jwt:Issuer"], 64 | audience : _configuration["Jwt:Issuer"], 65 | claims, 66 | expires : DateTime.Now.AddMinutes (120), 67 | signingCredentials : credentials 68 | ); 69 | 70 | var encodenToken = new JwtSecurityTokenHandler ().WriteToken (token); 71 | return encodenToken; 72 | } 73 | } 74 | 75 | } -------------------------------------------------------------------------------- /CommandBus/CommandHandlers/Auth/UserRegisterCommandHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using System.Threading.Tasks; 3 | using APIFuelStation.IRepositories; 4 | using APIFuelStation.Models; 5 | using MediatR; 6 | 7 | namespace APIFuelStation.CommandBus { 8 | 9 | public class UserRegisterCommandHandler : IRequestHandler { 10 | private readonly IUserRepository _userRepository; 11 | public UserRegisterCommandHandler (IUserRepository userRepository) { 12 | this._userRepository = userRepository; 13 | } 14 | 15 | public async Task Handle (UserRegisterCommand request, CancellationToken cancellationToken) { 16 | return await _userRepository.CreateUser (request.User); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /CommandBus/CommandHandlers/Department/CreateDepartmentHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using System.Threading.Tasks; 3 | using APIFuelStation.CommandBus.Commands; 4 | using APIFuelStation.IRepositories; 5 | using APIFuelStation.Models; 6 | using MediatR; 7 | 8 | namespace APIFuelStation.CommandBus 9 | { 10 | 11 | public class CreateDepartmentHandler : IRequestHandler 12 | { 13 | private readonly IDepartmentRepository _departmentRepository; 14 | public CreateDepartmentHandler(IDepartmentRepository departmentRepository) 15 | { 16 | this._departmentRepository = departmentRepository; 17 | } 18 | 19 | public async Task Handle(CreateDepartmentCommand request, CancellationToken cancellationToken) 20 | { 21 | return await _departmentRepository.CreateDepartment(request.Department); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /CommandBus/CommandHandlers/Department/DeleteDepartmentHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using System.Threading.Tasks; 3 | using APIFuelStation.CommandBus.Commands; 4 | using APIFuelStation.IRepositories; 5 | using APIFuelStation.Models; 6 | using MediatR; 7 | 8 | namespace APIFuelStation.CommandBus 9 | { 10 | 11 | public class DeleteDepartmentHandler : IRequestHandler 12 | { 13 | private readonly IDepartmentRepository _departmentRepository; 14 | public DeleteDepartmentHandler(IDepartmentRepository departmentRepository) 15 | { 16 | this._departmentRepository = departmentRepository; 17 | } 18 | 19 | public async Task Handle(DeleteDepartmentCommand request, CancellationToken cancellationToken) 20 | { 21 | return await _departmentRepository.DeleteDepartment(request.Department); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /CommandBus/CommandHandlers/Department/UpdateDepartmentHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using System.Threading.Tasks; 3 | using APIFuelStation.CommandBus.Commands; 4 | using APIFuelStation.IRepositories; 5 | using APIFuelStation.Models; 6 | using MediatR; 7 | 8 | namespace APIFuelStation.CommandBus 9 | { 10 | 11 | public class UpdateDepartmentHandler : IRequestHandler 12 | { 13 | private readonly IDepartmentRepository _departmentRepository; 14 | public UpdateDepartmentHandler(IDepartmentRepository departmentRepository) 15 | { 16 | this._departmentRepository = departmentRepository; 17 | } 18 | 19 | public async Task Handle(UpdateDepartmentCommand request, CancellationToken cancellationToken) 20 | { 21 | return await _departmentRepository.UpdateDepartment(request.Department); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /CommandBus/CommandHandlers/Designation/CreateDesignationHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using System.Threading.Tasks; 3 | using APIFuelStation.CommandBus.Commands; 4 | using APIFuelStation.IRepositories; 5 | using APIFuelStation.Models; 6 | using MediatR; 7 | 8 | namespace APIFuelStation.CommandBus 9 | { 10 | 11 | public class CreateDesignationHandler : IRequestHandler 12 | { 13 | private readonly IDesignationRepository _designationRepository; 14 | public CreateDesignationHandler(IDesignationRepository designationRepository) 15 | { 16 | this._designationRepository = designationRepository; 17 | } 18 | 19 | public async Task Handle(CreateDesignationCommand request, CancellationToken cancellationToken) 20 | { 21 | return await _designationRepository.CreateDesignation(request.Designation); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /CommandBus/CommandHandlers/Designation/DeleteDesignationHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using System.Threading.Tasks; 3 | using APIFuelStation.CommandBus.Commands; 4 | using APIFuelStation.IRepositories; 5 | using APIFuelStation.Models; 6 | using MediatR; 7 | 8 | namespace APIFuelStation.CommandBus 9 | { 10 | 11 | public class DeleteDesignationHandler : IRequestHandler 12 | { 13 | private readonly IDesignationRepository _designationRepository; 14 | public DeleteDesignationHandler(IDesignationRepository designationRepository) 15 | { 16 | this._designationRepository = designationRepository; 17 | } 18 | 19 | public async Task Handle(DeleteDesignationCommand request, CancellationToken cancellationToken) 20 | { 21 | return await _designationRepository.DeleteDesignation(request.Designation); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /CommandBus/CommandHandlers/Designation/UpdateDesignationHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using System.Threading.Tasks; 3 | using APIFuelStation.CommandBus.Commands; 4 | using APIFuelStation.IRepositories; 5 | using APIFuelStation.Models; 6 | using MediatR; 7 | 8 | namespace APIFuelStation.CommandBus 9 | { 10 | 11 | public class UpdateDesignationHandler : IRequestHandler 12 | { 13 | private readonly IDesignationRepository _designationRepository; 14 | public UpdateDesignationHandler(IDesignationRepository designationRepository) 15 | { 16 | this._designationRepository = designationRepository; 17 | } 18 | 19 | public async Task Handle(UpdateDesignationCommand request, CancellationToken cancellationToken) 20 | { 21 | return await _designationRepository.UpdateDesignation(request.Designation); 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /CommandBus/CommandHandlers/Employee/CreateEmployeeHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using System.Threading.Tasks; 3 | using APIFuelStation.CommandBus.Commands; 4 | using APIFuelStation.IRepositories; 5 | using APIFuelStation.Models; 6 | using MediatR; 7 | 8 | namespace APIFuelStation.CommandBus { 9 | 10 | public class CreateEmployeeHandler : IRequestHandler { 11 | private readonly IEmployeeRepository _employeeRepository; 12 | public CreateEmployeeHandler (IEmployeeRepository employeeRepository) { 13 | this._employeeRepository = employeeRepository; 14 | } 15 | 16 | public async Task Handle (CreateEmployeeCommand request, CancellationToken cancellationToken) { 17 | return await _employeeRepository.CreateEmployee (request.Employee); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /CommandBus/CommandHandlers/Employee/DeleteEmployeeHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using System.Threading.Tasks; 3 | using APIFuelStation.CommandBus.Commands; 4 | using APIFuelStation.IRepositories; 5 | using APIFuelStation.Models; 6 | using MediatR; 7 | 8 | namespace APIFuelStation.CommandBus { 9 | 10 | public class DeleteEmployeeHandler : IRequestHandler { 11 | private readonly IEmployeeRepository _employeeRepository; 12 | public DeleteEmployeeHandler (IEmployeeRepository employeeRepository) { 13 | this._employeeRepository = employeeRepository; 14 | } 15 | 16 | public async Task Handle (DeleteEmployeeCommand request, CancellationToken cancellationToken) { 17 | return await _employeeRepository.DeleteEmployee (request.Employee); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /CommandBus/CommandHandlers/Employee/UpdateEmployeeHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using System.Threading.Tasks; 3 | using APIFuelStation.CommandBus.Commands; 4 | using APIFuelStation.IRepositories; 5 | using APIFuelStation.Models; 6 | using MediatR; 7 | 8 | namespace APIFuelStation.CommandBus { 9 | 10 | public class UpdateEmployeeHandler : IRequestHandler { 11 | private readonly IEmployeeRepository _employeeRepository; 12 | public UpdateEmployeeHandler (IEmployeeRepository employeeRepository) { 13 | this._employeeRepository = employeeRepository; 14 | } 15 | 16 | public async Task Handle (UpdateEmployeeCommand request, CancellationToken cancellationToken) { 17 | return await _employeeRepository.UpdateEmployee (request.Employee); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /CommandBus/CommandHandlers/User/CreateUserHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using System.Threading.Tasks; 3 | using APIFuelStation.CommandBus.Commands; 4 | using APIFuelStation.IRepositories; 5 | using APIFuelStation.Models; 6 | using MediatR; 7 | 8 | namespace APIFuelStation.CommandBus { 9 | 10 | public class CreateUserHandler : IRequestHandler { 11 | private readonly IUserRepository _userRepository; 12 | public CreateUserHandler (IUserRepository userRepository) { 13 | this._userRepository = userRepository; 14 | } 15 | 16 | public async Task Handle (CreateUserCommand request, CancellationToken cancellationToken) { 17 | return await _userRepository.CreateUser (request.User); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /CommandBus/CommandHandlers/User/DeleteUserHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using System.Threading.Tasks; 3 | using APIFuelStation.CommandBus.Commands; 4 | using APIFuelStation.IRepositories; 5 | using APIFuelStation.Models; 6 | using MediatR; 7 | 8 | namespace APIFuelStation.CommandBus { 9 | 10 | public class DeleteUserHandler : IRequestHandler { 11 | private readonly IUserRepository _userRepository; 12 | public DeleteUserHandler (IUserRepository userRepository) { 13 | this._userRepository = userRepository; 14 | } 15 | 16 | public async Task Handle (DeleteUserCommand request, CancellationToken cancellationToken) { 17 | return await _userRepository.DeleteUser (request.User); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /CommandBus/CommandHandlers/User/UpdateUserHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using System.Threading.Tasks; 3 | using APIFuelStation.CommandBus.Commands; 4 | using APIFuelStation.IRepositories; 5 | using APIFuelStation.Models; 6 | using MediatR; 7 | 8 | namespace APIFuelStation.CommandBus { 9 | 10 | public class UpdateUserHandler : IRequestHandler { 11 | private readonly IUserRepository _userRepository; 12 | public UpdateUserHandler (IUserRepository userRepository) { 13 | this._userRepository = userRepository; 14 | } 15 | 16 | public async Task Handle (UpdateUserCommand request, CancellationToken cancellationToken) { 17 | return await _userRepository.UpdateUser (request.User); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /CommandBus/Commands/Auth/UserAuthCommand.cs: -------------------------------------------------------------------------------- 1 | using APIFuelStation.ViewModel; 2 | using MediatR; 3 | 4 | namespace APIFuelStation.CommandBus.Commands { 5 | public class UserAuthCommand : IRequest { 6 | public string Email { get; set; } 7 | public string Password { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /CommandBus/Commands/Auth/UserRegisterCommand.cs: -------------------------------------------------------------------------------- 1 | using APIFuelStation.Models; 2 | using APIFuelStation.ViewModel; 3 | using MediatR; 4 | 5 | namespace APIFuelStation.CommandBus { 6 | public class UserRegisterCommand : IRequest { 7 | public User User { get; } 8 | 9 | public UserRegisterCommand (User user) { 10 | User = user; 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /CommandBus/Commands/Department/CreateDepartmentCommand.cs: -------------------------------------------------------------------------------- 1 | using APIFuelStation.Models; 2 | using MediatR; 3 | 4 | namespace APIFuelStation.CommandBus.Commands 5 | { 6 | public class CreateDepartmentCommand : IRequest 7 | { 8 | public CreateDepartmentCommand(Department department) 9 | { 10 | Department = department; 11 | } 12 | public Department Department { get; } 13 | } 14 | } -------------------------------------------------------------------------------- /CommandBus/Commands/Department/DeleteDepartmentCommand.cs: -------------------------------------------------------------------------------- 1 | using APIFuelStation.Models; 2 | using MediatR; 3 | 4 | namespace APIFuelStation.CommandBus.Commands 5 | { 6 | public class DeleteDepartmentCommand : IRequest 7 | { 8 | public DeleteDepartmentCommand(Department department) 9 | { 10 | Department = department; 11 | } 12 | public Department Department { get; } 13 | } 14 | } -------------------------------------------------------------------------------- /CommandBus/Commands/Department/UpdateDepartmentCommand.cs: -------------------------------------------------------------------------------- 1 | using APIFuelStation.Models; 2 | using MediatR; 3 | 4 | namespace APIFuelStation.CommandBus.Commands 5 | { 6 | public class UpdateDepartmentCommand : IRequest 7 | { 8 | public UpdateDepartmentCommand(Department department) 9 | { 10 | Department = department; 11 | } 12 | public Department Department { get; } 13 | } 14 | } -------------------------------------------------------------------------------- /CommandBus/Commands/Designation/CreateDesignationCommand.cs: -------------------------------------------------------------------------------- 1 | using APIFuelStation.Models; 2 | using MediatR; 3 | 4 | namespace APIFuelStation.CommandBus.Commands 5 | { 6 | public class CreateDesignationCommand : IRequest 7 | { 8 | public CreateDesignationCommand(Designation designation) 9 | { 10 | Designation = designation; 11 | } 12 | public Designation Designation { get; } 13 | } 14 | } -------------------------------------------------------------------------------- /CommandBus/Commands/Designation/DeleteDesignationCommand.cs: -------------------------------------------------------------------------------- 1 | using APIFuelStation.Models; 2 | using MediatR; 3 | 4 | namespace APIFuelStation.CommandBus.Commands 5 | { 6 | public class DeleteDesignationCommand : IRequest 7 | { 8 | public DeleteDesignationCommand(Designation designation) 9 | { 10 | Designation = designation; 11 | } 12 | public Designation Designation { get; } 13 | } 14 | } -------------------------------------------------------------------------------- /CommandBus/Commands/Designation/UpdateDesignationCommand.cs: -------------------------------------------------------------------------------- 1 | using APIFuelStation.Models; 2 | using MediatR; 3 | 4 | namespace APIFuelStation.CommandBus.Commands 5 | { 6 | public class UpdateDesignationCommand : IRequest 7 | { 8 | public UpdateDesignationCommand(Designation designation) 9 | { 10 | Designation = designation; 11 | } 12 | public Designation Designation { get; } 13 | } 14 | } -------------------------------------------------------------------------------- /CommandBus/Commands/Employee/CreateEmployeeCommand.cs: -------------------------------------------------------------------------------- 1 | using APIFuelStation.Models; 2 | using MediatR; 3 | 4 | namespace APIFuelStation.CommandBus.Commands { 5 | public class CreateEmployeeCommand : IRequest { 6 | public CreateEmployeeCommand (Employee employee) { 7 | Employee = employee; 8 | } 9 | public Employee Employee { get; } 10 | } 11 | } -------------------------------------------------------------------------------- /CommandBus/Commands/Employee/DeleteEmployeeCommand.cs: -------------------------------------------------------------------------------- 1 | using APIFuelStation.Models; 2 | using MediatR; 3 | 4 | namespace APIFuelStation.CommandBus.Commands { 5 | public class DeleteEmployeeCommand : IRequest { 6 | public DeleteEmployeeCommand (Employee employee) { 7 | Employee = employee; 8 | } 9 | public Employee Employee { get; } 10 | } 11 | } -------------------------------------------------------------------------------- /CommandBus/Commands/Employee/UpdateEmployeeCommand.cs: -------------------------------------------------------------------------------- 1 | using APIFuelStation.Models; 2 | using MediatR; 3 | 4 | namespace APIFuelStation.CommandBus.Commands { 5 | public class UpdateEmployeeCommand : IRequest { 6 | public UpdateEmployeeCommand (Employee employee) { 7 | Employee = employee; 8 | } 9 | public Employee Employee { get; } 10 | } 11 | } -------------------------------------------------------------------------------- /CommandBus/Commands/User/CreateUserCommand.cs: -------------------------------------------------------------------------------- 1 | using APIFuelStation.Models; 2 | using MediatR; 3 | 4 | namespace APIFuelStation.CommandBus.Commands { 5 | public class CreateUserCommand : IRequest { 6 | public CreateUserCommand (User user) { 7 | User = user; 8 | } 9 | public User User { get; } 10 | } 11 | } -------------------------------------------------------------------------------- /CommandBus/Commands/User/DeleteUserCommand.cs: -------------------------------------------------------------------------------- 1 | using APIFuelStation.Models; 2 | using MediatR; 3 | 4 | namespace APIFuelStation.CommandBus.Commands { 5 | public class DeleteUserCommand : IRequest { 6 | public DeleteUserCommand (User user) { 7 | User = user; 8 | } 9 | public User User { get; } 10 | } 11 | } -------------------------------------------------------------------------------- /CommandBus/Commands/User/UpdateUserCommand.cs: -------------------------------------------------------------------------------- 1 | using APIFuelStation.Models; 2 | using MediatR; 3 | 4 | namespace APIFuelStation.CommandBus.Commands { 5 | public class UpdateUserCommand : IRequest { 6 | public UpdateUserCommand (User user) { 7 | User = user; 8 | } 9 | public User User { get; } 10 | } 11 | } -------------------------------------------------------------------------------- /Controllers/AuthController.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 System.Threading.Tasks; 8 | using APIFuelStation.CommandBus; 9 | using APIFuelStation.CommandBus.Commands; 10 | using APIFuelStation.Models; 11 | using AutoMapper; 12 | using MediatR; 13 | using Microsoft.AspNetCore.Authorization; 14 | using Microsoft.AspNetCore.JsonPatch; 15 | using Microsoft.AspNetCore.Mvc; 16 | using Microsoft.Extensions.Configuration; 17 | using Microsoft.IdentityModel.Tokens; 18 | 19 | namespace APIFuelStation.Controllers { 20 | [ApiController] 21 | [Route ("[controller]")] 22 | public class AuthController : ControllerBase { 23 | 24 | private readonly IConfiguration _configuration; 25 | private readonly IMediator _mediator; 26 | public AuthController (IConfiguration confirugation, IMediator mediator) { 27 | this._configuration = confirugation; 28 | this._mediator = mediator; 29 | } 30 | 31 | [HttpPost ("Login")] 32 | public async Task Login ([FromBody] UserAuthCommand command) { 33 | var result = await _mediator.Send (command); 34 | return Ok (result); 35 | } 36 | 37 | [HttpPost ("Register")] 38 | public async Task Register ([FromBody] UserRegisterCommand command) { 39 | var result = await _mediator.Send (command); 40 | return Ok (result); 41 | } 42 | 43 | } 44 | } -------------------------------------------------------------------------------- /Controllers/DepartmentsController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using APIFuelStation.CommandBus; 4 | using APIFuelStation.CommandBus.Commands; 5 | using APIFuelStation.Models; 6 | using APIFuelStation.QueryBus; 7 | using APIFuelStation.QueryBus.Queries; 8 | using AutoMapper; 9 | using MediatR; 10 | using Microsoft.AspNetCore.Authorization; 11 | using Microsoft.AspNetCore.JsonPatch; 12 | using Microsoft.AspNetCore.Mvc; 13 | 14 | namespace APIFuelStation.Controllers 15 | { 16 | 17 | [Produces("application/json")] 18 | [Route("/api/[controller]")] 19 | [ApiController] 20 | public class DepartmentsController : ControllerBase 21 | { 22 | private readonly IMediator _mediator; 23 | 24 | public DepartmentsController(IMediator mediator) 25 | { 26 | this._mediator = mediator; 27 | } 28 | 29 | // [Authorize] 30 | /// 31 | /// Get All of the Departments List 32 | /// 33 | /// A New Department 34 | [Authorize] 35 | [HttpGet] 36 | public async Task GetAllDepartments() 37 | { 38 | var allDepartments = await _mediator.Send(new GetAllDepartmentQuery()); 39 | return Ok(allDepartments); 40 | } 41 | 42 | // [Authorize] 43 | /// 44 | /// Get Single Department By ID 45 | /// 46 | /// Get an Department 47 | /// If user id not found 48 | [Authorize] 49 | [HttpGet("{id}", Name = "GetDepartmentById")] 50 | public async Task GetDepartmentById(int id) 51 | { 52 | var user = await _mediator.Send(new GetSingleDepartmentQuery(id)); 53 | if (user == null) 54 | return NotFound(); 55 | return Ok(user); 56 | } 57 | 58 | /// 59 | /// Creates a New Department 60 | /// 61 | /// 62 | /// Sample request: 63 | /// 64 | /// { 65 | /// "id": 0, 66 | /// "name": "Department 1", 67 | /// "code": "DEP12", 68 | /// } 69 | /// 70 | /// 71 | /// A newly created Department Item 72 | /// Returns the newly created item 73 | /// If any of the field is null 74 | [Authorize] 75 | [HttpPost] 76 | public async Task CreateDepartment(Department user) 77 | { 78 | var userResponse = await _mediator.Send(new CreateDepartmentCommand(user)); 79 | return Ok(userResponse); 80 | } 81 | 82 | /// 83 | /// Updates a user 84 | /// 85 | /// 86 | /// Sample request: 87 | /// 88 | /// { 89 | /// "id": 0, 90 | /// "firstName": "Maniruzzaman", 91 | /// "lastName": "Akash", 92 | /// "userName": "maniruzzaman", 93 | /// "email": "maniruzzamanAkash@gmail.com", 94 | /// "phoneNo": "01951233084", 95 | /// "password": "123456", 96 | /// "avatar": "string", 97 | /// "gender": true 98 | /// } 99 | /// 100 | /// 101 | /// A newly updated Department Item 102 | /// Returns the newly updated user 103 | /// If any of the field is null 104 | /// If user id not found 105 | [Authorize] 106 | [HttpPut("{id}", Name = "UpdateDepartment")] 107 | public async Task UpdateDepartment(int id, Department user) 108 | { 109 | var departmentSearchByID = await _mediator.Send(new GetSingleDepartmentQuery(id)); 110 | if (departmentSearchByID == null) 111 | return NotFound(); 112 | 113 | var userResponse = await _mediator.Send(new UpdateDepartmentCommand(user)); 114 | return Ok(userResponse); 115 | } 116 | 117 | /// 118 | /// Deletes a user 119 | /// 120 | /// Deleted Department Item 121 | /// Returns the newly deleted user 122 | /// If any of the field is null 123 | /// If user id not found 124 | [Authorize] 125 | [HttpDelete("{id}", Name = "DeleteDepartment")] 126 | public async Task DeleteDepartment(int id) 127 | { 128 | var departmentSearchByID = await _mediator.Send(new GetSingleDepartmentQuery(id)); 129 | if (departmentSearchByID == null) 130 | return NotFound(); 131 | 132 | var userResponse = await _mediator.Send(new DeleteDepartmentCommand(departmentSearchByID)); 133 | return Ok(userResponse); 134 | } 135 | } 136 | } -------------------------------------------------------------------------------- /Controllers/DesignationsController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using APIFuelStation.CommandBus; 4 | using APIFuelStation.CommandBus.Commands; 5 | using APIFuelStation.Models; 6 | using APIFuelStation.QueryBus; 7 | using APIFuelStation.QueryBus.Queries; 8 | using AutoMapper; 9 | using MediatR; 10 | using Microsoft.AspNetCore.Authorization; 11 | using Microsoft.AspNetCore.JsonPatch; 12 | using Microsoft.AspNetCore.Mvc; 13 | 14 | namespace APIFuelStation.Controllers 15 | { 16 | 17 | [Produces("application/json")] 18 | [Route("/api/[controller]")] 19 | [ApiController] 20 | public class DesignationsController : ControllerBase 21 | { 22 | private readonly IMediator _mediator; 23 | 24 | public DesignationsController(IMediator mediator) 25 | { 26 | this._mediator = mediator; 27 | } 28 | 29 | // [Authorize] 30 | /// 31 | /// Get All of the Designations List 32 | /// 33 | /// A New Designation 34 | [Authorize] 35 | [HttpGet] 36 | public async Task GetAllDesignations() 37 | { 38 | var allDesignations = await _mediator.Send(new GetAllDesignationQuery()); 39 | return Ok(allDesignations); 40 | } 41 | 42 | // [Authorize] 43 | /// 44 | /// Get Single Designation By ID 45 | /// 46 | /// Get an Designation 47 | /// If user id not found 48 | [Authorize] 49 | [HttpGet("{id}", Name = "GetDesignationById")] 50 | public async Task GetDesignationById(int id) 51 | { 52 | var user = await _mediator.Send(new GetSingleDesignationQuery(id)); 53 | if (user == null) 54 | return NotFound(); 55 | return Ok(user); 56 | } 57 | 58 | /// 59 | /// Creates a New Designation 60 | /// 61 | /// 62 | /// Sample request: 63 | /// 64 | /// { 65 | /// "id": 0, 66 | /// "name": "Designation 1", 67 | /// "code": "DEP12", 68 | /// } 69 | /// 70 | /// 71 | /// A newly created Designation Item 72 | /// Returns the newly created item 73 | /// If any of the field is null 74 | [Authorize] 75 | [HttpPost] 76 | public async Task CreateDesignation(Designation user) 77 | { 78 | var userResponse = await _mediator.Send(new CreateDesignationCommand(user)); 79 | return Ok(userResponse); 80 | } 81 | 82 | /// 83 | /// Updates a user 84 | /// 85 | /// 86 | /// Sample request: 87 | /// 88 | /// { 89 | /// "id": 0, 90 | /// "firstName": "Maniruzzaman", 91 | /// "lastName": "Akash", 92 | /// "userName": "maniruzzaman", 93 | /// "email": "maniruzzamanAkash@gmail.com", 94 | /// "phoneNo": "01951233084", 95 | /// "password": "123456", 96 | /// "avatar": "string", 97 | /// "gender": true 98 | /// } 99 | /// 100 | /// 101 | /// A newly updated Designation Item 102 | /// Returns the newly updated user 103 | /// If any of the field is null 104 | /// If user id not found 105 | [Authorize] 106 | [HttpPut("{id}", Name = "UpdateDesignation")] 107 | public async Task UpdateDesignation(int id, Designation user) 108 | { 109 | var designationSearchByID = await _mediator.Send(new GetSingleDesignationQuery(id)); 110 | if (designationSearchByID == null) 111 | return NotFound(); 112 | 113 | var userResponse = await _mediator.Send(new UpdateDesignationCommand(user)); 114 | return Ok(userResponse); 115 | } 116 | 117 | /// 118 | /// Deletes a user 119 | /// 120 | /// Deleted Designation Item 121 | /// Returns the newly deleted user 122 | /// If any of the field is null 123 | /// If user id not found 124 | [Authorize] 125 | [HttpDelete("{id}", Name = "DeleteDesignation")] 126 | public async Task DeleteDesignation(int id) 127 | { 128 | var designationSearchByID = await _mediator.Send(new GetSingleDesignationQuery(id)); 129 | if (designationSearchByID == null) 130 | return NotFound(); 131 | 132 | var userResponse = await _mediator.Send(new DeleteDesignationCommand(designationSearchByID)); 133 | return Ok(userResponse); 134 | } 135 | } 136 | } -------------------------------------------------------------------------------- /Controllers/DummyControllerExample.cs: -------------------------------------------------------------------------------- 1 | namespace APIFuelStation.Controllers { 2 | public class DummyControllerExample { 3 | // private readonly IMediator _mediator; 4 | 5 | // public UsersController (IMediator mediator) { 6 | // this._mediator = mediator; 7 | // } 8 | 9 | // // [Authorize] 10 | // /// 11 | // /// Get All of the Users List 12 | // /// 13 | // /// A New User 14 | // [Authorize] 15 | // [HttpGet] 16 | // public async Task GetAllUsers () { 17 | // var allUsers = await _mediator.Send (new GetAllUserQuery ()); 18 | // return Ok (allUsers); 19 | // } 20 | 21 | // // [Authorize] 22 | // /// 23 | // /// Get Single User By ID 24 | // /// 25 | // /// Get an User 26 | // /// If user id not found 27 | // [Authorize] 28 | // [HttpGet ("{id}", Name = "GetUserById")] 29 | // public async Task GetUserById (int id) { 30 | // var user = await _mediator.Send (new GetSingleUserQuery (id)); 31 | // if (user == null) 32 | // return NotFound (); 33 | // return Ok (user); 34 | // } 35 | 36 | // /// 37 | // /// Creates a New User 38 | // /// 39 | // /// 40 | // /// Sample request: 41 | // /// 42 | // /// { 43 | // /// "id": 0, 44 | // /// "firstName": "Maniruzzaman", 45 | // /// "lastName": "Akash", 46 | // /// "userName": "maniruzzaman", 47 | // /// "email": "maniruzzamanAkash@gmail.com", 48 | // /// "phoneNo": "01951233084", 49 | // /// "password": "123456", 50 | // /// "avatar": "string", 51 | // /// "gender": true 52 | // /// } 53 | // /// 54 | // /// 55 | // /// A newly created User Item 56 | // /// Returns the newly created item 57 | // /// If any of the field is null 58 | // [Authorize] 59 | // [HttpPost] 60 | // public async Task CreateUser (User user) { 61 | // var userResponse = await _mediator.Send (new CreateUserCommand (user)); 62 | // return Ok (userResponse); 63 | // } 64 | 65 | // /// 66 | // /// Updates a user 67 | // /// 68 | // /// 69 | // /// Sample request: 70 | // /// 71 | // /// { 72 | // /// "id": 0, 73 | // /// "firstName": "Maniruzzaman", 74 | // /// "lastName": "Akash", 75 | // /// "userName": "maniruzzaman", 76 | // /// "email": "maniruzzamanAkash@gmail.com", 77 | // /// "phoneNo": "01951233084", 78 | // /// "password": "123456", 79 | // /// "avatar": "string", 80 | // /// "gender": true 81 | // /// } 82 | // /// 83 | // /// 84 | // /// A newly updated User Item 85 | // /// Returns the newly updated user 86 | // /// If any of the field is null 87 | // /// If user id not found 88 | // [Authorize] 89 | // [HttpPut ("{id}", Name = "UpdateUser")] 90 | // public async Task UpdateUser (int id, User user) { 91 | // var userSearchByID = await _mediator.Send (new GetSingleUserQuery (id)); 92 | // if (userSearchByID == null) 93 | // return NotFound (); 94 | 95 | // var userResponse = await _mediator.Send (new UpdateUserCommand (user)); 96 | // return Ok (userResponse); 97 | // } 98 | 99 | // /// 100 | // /// Deletes a user 101 | // /// 102 | // /// Deleted User Item 103 | // /// Returns the newly deleted user 104 | // /// If any of the field is null 105 | // /// If user id not found 106 | // [Authorize] 107 | // [HttpDelete ("{id}", Name = "DeleteUser")] 108 | // public async Task DeleteUser (int id) { 109 | // var userSearchByID = await _mediator.Send (new GetSingleUserQuery (id)); 110 | // if (userSearchByID == null) 111 | // return NotFound (); 112 | 113 | // var userResponse = await _mediator.Send (new DeleteUserCommand (userSearchByID)); 114 | // return Ok (userResponse); 115 | // } 116 | 117 | // [Authorize] 118 | // [HttpGet("{id}", Name = "GetCategoryById")] 119 | // public ActionResult GetCategoryById(int id) 120 | // { 121 | // var categoryItem = _repository.GetCategoryById(id); 122 | // if (categoryItem == null) 123 | // return NotFound(); 124 | // return Ok(_mapper.Map(categoryItem)); 125 | // } 126 | 127 | // [Authorize] 128 | // // POST api/categories 129 | // [HttpPost] 130 | // public ActionResult CreateCategory(CategoryCreateDto categoryCreateDto) 131 | // { 132 | // var categoryModel = _mapper.Map(categoryCreateDto); 133 | // _repository.CreateCategory(categoryModel); 134 | // _repository.SaveChanges(); 135 | 136 | // var categoryReadDto = _mapper.Map(categoryModel); 137 | 138 | // return CreatedAtRoute(nameof(GetCategoryById), new { Id = categoryReadDto.Id }, categoryReadDto); 139 | 140 | // //return Ok(commandReadDto); 141 | // } 142 | 143 | // [Authorize] 144 | // POST api/categories 145 | // [HttpPost] 146 | // public async Task CreateCategory([FromBody] CreateCategoryOrderRequest request) 147 | // { 148 | // var categoryModel = _mapper.Map(categoryCreateDto); 149 | // _repository.CreateCategory(categoryModel); 150 | // _repository.SaveChanges(); 151 | 152 | // var categoryReadDto = _mapper.Map(categoryModel); 153 | 154 | // return CreatedAtRoute(nameof(GetCategoryById), new { Id = categoryReadDto.Id }, categoryReadDto); 155 | 156 | // //return Ok(commandReadDto); 157 | // } 158 | 159 | // [Authorize] 160 | // // PUT api/categories 161 | // [HttpPut("{id}")] 162 | // public ActionResult UpdateCategory(int id, CategoryCreateDto CategoryUpdateDto) 163 | // { 164 | // var categorydModelFromRepo = _repository.GetCategoryById(id); 165 | // if (categorydModelFromRepo == null) 166 | // { 167 | // return NotFound(); 168 | // } 169 | 170 | // _mapper.Map(CategoryUpdateDto, categorydModelFromRepo); 171 | 172 | // _repository.UpdateCategory(categorydModelFromRepo); 173 | 174 | // _repository.SaveChanges(); 175 | 176 | // var categoryReadItem = _repository.GetCategoryById(id); 177 | // if (categoryReadItem == null) 178 | // return NoContent(); 179 | // return Ok(_mapper.Map(categoryReadItem)); 180 | // } 181 | 182 | // [Authorize] 183 | // // PATCH api/categories 184 | // [HttpPatch("{id}")] 185 | // public ActionResult PartialUpdateCategory(int id, JsonPatchDocument patchDoc) 186 | // { 187 | // var categoryModelFromRepo = _repository.GetCategoryById(id); 188 | // if (categoryModelFromRepo == null) 189 | // { 190 | // return NotFound(); 191 | // } 192 | 193 | // var categoryToPatch = _mapper.Map(categoryModelFromRepo); 194 | // patchDoc.ApplyTo(categoryToPatch, ModelState); 195 | 196 | // if (!TryValidateModel(categoryToPatch)) 197 | // { 198 | // return ValidationProblem(ModelState); 199 | // } 200 | 201 | // _mapper.Map(categoryToPatch, categoryModelFromRepo); 202 | // _repository.UpdateCategory(categoryModelFromRepo); 203 | // _repository.SaveChanges(); 204 | 205 | // var categoryReadItem = _repository.GetCategoryById(id); 206 | // if (categoryReadItem == null) 207 | // return NoContent(); 208 | // return Ok(_mapper.Map(categoryReadItem)); 209 | // } 210 | 211 | // [Authorize] 212 | // // DELeTE api/categories 213 | // [HttpDelete("{id}")] 214 | // public ActionResult DeleteCategory(int id) 215 | // { 216 | // var categoryModelFromRepo = _repository.GetCategoryById(id); 217 | // if (categoryModelFromRepo == null) 218 | // { 219 | // return NotFound(); 220 | // } 221 | 222 | // _repository.DeleteCategory(categoryModelFromRepo); 223 | // _repository.SaveChanges(); 224 | 225 | // return NoContent(); 226 | // } 227 | } 228 | } -------------------------------------------------------------------------------- /Controllers/EmployeesController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using APIFuelStation.CommandBus; 4 | using APIFuelStation.CommandBus.Commands; 5 | using APIFuelStation.Models; 6 | using APIFuelStation.QueryBus.Queries; 7 | using AutoMapper; 8 | using MediatR; 9 | using Microsoft.AspNetCore.Authorization; 10 | using Microsoft.AspNetCore.JsonPatch; 11 | using Microsoft.AspNetCore.Mvc; 12 | 13 | namespace APIFuelStation.Controllers { 14 | 15 | [Produces ("application/json")] 16 | [Route ("/api/[controller]")] 17 | [ApiController] 18 | public class EmployeesController : ControllerBase { 19 | private readonly IMediator _mediator; 20 | 21 | public EmployeesController (IMediator mediator) { 22 | this._mediator = mediator; 23 | } 24 | 25 | // [Authorize] 26 | /// 27 | /// Get All of the Employees List 28 | /// 29 | /// A New Employee 30 | [Authorize] 31 | [HttpGet] 32 | public async Task GetAllEmployees () { 33 | var allEmployees = await _mediator.Send (new GetAllEmployeeQuery ()); 34 | return Ok (allEmployees); 35 | } 36 | 37 | // [Authorize] 38 | /// 39 | /// Get Single Employee By ID 40 | /// 41 | /// Get an Employee 42 | /// If user id not found 43 | [Authorize] 44 | [HttpGet ("{id}", Name = "GetEmployeeById")] 45 | public async Task GetEmployeeById (int id) { 46 | var user = await _mediator.Send (new GetSingleEmployeeQuery (id)); 47 | if (user == null) 48 | return NotFound (); 49 | return Ok (user); 50 | } 51 | 52 | /// 53 | /// Creates a New Employee 54 | /// 55 | /// 56 | /// Sample request: 57 | /// 58 | /// { 59 | /// "id": 0, 60 | /// "firstName": "string", 61 | /// "userName": "string", 62 | /// "email": "string", 63 | /// "phoneNo": "string", 64 | /// "gender": true, 65 | /// "lastName": "string", 66 | /// "password": "string", 67 | /// "avatar": "string", 68 | /// "joiningDate": "2020-06-23", 69 | /// "designationId": 0, 70 | /// "departmentId": 0 71 | /// } 72 | /// 73 | /// 74 | /// A newly created Employee Item 75 | /// Returns the newly created item 76 | /// If any of the field is null 77 | [Authorize] 78 | [HttpPost] 79 | public async Task CreateEmployee (Employee user) { 80 | var userResponse = await _mediator.Send (new CreateEmployeeCommand (user)); 81 | return Ok (userResponse); 82 | } 83 | 84 | /// 85 | /// Updates an employee 86 | /// 87 | /// 88 | /// Sample request: 89 | /// 90 | /// { 91 | /// "id": 1, 92 | /// "firstName": "string", 93 | /// "userName": "string", 94 | /// "email": "string", 95 | /// "phoneNo": "string", 96 | /// "gender": true, 97 | /// "lastName": "string", 98 | /// "password": "string", 99 | /// "avatar": "string", 100 | /// "joiningDate": "2020-06-23", 101 | /// "designationId": 0, 102 | /// "departmentId": 0 103 | /// } 104 | /// 105 | /// 106 | /// A newly updated Employee Item 107 | /// Returns the newly updated user 108 | /// If any of the field is null 109 | /// If user id not found 110 | [Authorize] 111 | [HttpPut ("{id}", Name = "UpdateEmployee")] 112 | public async Task UpdateEmployee (int id, Employee user) { 113 | var userSearchByID = await _mediator.Send (new GetSingleEmployeeQuery (id)); 114 | if (userSearchByID == null) 115 | return NotFound (); 116 | 117 | var userResponse = await _mediator.Send (new UpdateEmployeeCommand (user)); 118 | return Ok (userResponse); 119 | } 120 | 121 | /// 122 | /// Deletes a user 123 | /// 124 | /// Deleted Employee Item 125 | /// Returns the newly deleted user 126 | /// If any of the field is null 127 | /// If user id not found 128 | [Authorize] 129 | [HttpDelete ("{id}", Name = "DeleteEmployee")] 130 | public async Task DeleteEmployee (int id) { 131 | var userSearchByID = await _mediator.Send (new GetSingleEmployeeQuery (id)); 132 | if (userSearchByID == null) 133 | return NotFound (); 134 | 135 | var userResponse = await _mediator.Send (new DeleteEmployeeCommand (userSearchByID)); 136 | return Ok (userResponse); 137 | } 138 | } 139 | } -------------------------------------------------------------------------------- /Controllers/UsersController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using APIFuelStation.CommandBus; 4 | using APIFuelStation.CommandBus.Commands; 5 | using APIFuelStation.Models; 6 | using APIFuelStation.QueryBus.Queries; 7 | using AutoMapper; 8 | using MediatR; 9 | using Microsoft.AspNetCore.Authorization; 10 | using Microsoft.AspNetCore.JsonPatch; 11 | using Microsoft.AspNetCore.Mvc; 12 | 13 | namespace APIFuelStation.Controllers { 14 | 15 | [Produces ("application/json")] 16 | [Route ("/api/[controller]")] 17 | [ApiController] 18 | public class UsersController : ControllerBase { 19 | private readonly IMediator _mediator; 20 | 21 | public UsersController (IMediator mediator) { 22 | this._mediator = mediator; 23 | } 24 | 25 | // [Authorize] 26 | /// 27 | /// Get All of the Users List 28 | /// 29 | /// A New User 30 | [Authorize] 31 | [HttpGet] 32 | public async Task GetAllUsers () { 33 | var allUsers = await _mediator.Send (new GetAllUserQuery ()); 34 | return Ok (allUsers); 35 | } 36 | 37 | // [Authorize] 38 | /// 39 | /// Get Single User By ID 40 | /// 41 | /// Get an User 42 | /// If user id not found 43 | [Authorize] 44 | [HttpGet ("{id}", Name = "GetUserById")] 45 | public async Task GetUserById (int id) { 46 | var user = await _mediator.Send (new GetSingleUserQuery (id)); 47 | if (user == null) 48 | return NotFound (); 49 | return Ok (user); 50 | } 51 | 52 | /// 53 | /// Creates a New User 54 | /// 55 | /// 56 | /// Sample request: 57 | /// 58 | /// { 59 | /// "id": 0, 60 | /// "firstName": "Maniruzzaman", 61 | /// "lastName": "Akash", 62 | /// "userName": "maniruzzaman", 63 | /// "email": "maniruzzamanAkash@gmail.com", 64 | /// "phoneNo": "01951233084", 65 | /// "password": "123456", 66 | /// "avatar": "string", 67 | /// "gender": true 68 | /// } 69 | /// 70 | /// 71 | /// A newly created User Item 72 | /// Returns the newly created item 73 | /// If any of the field is null 74 | [Authorize] 75 | [HttpPost] 76 | public async Task CreateUser (User user) { 77 | var userResponse = await _mediator.Send (new CreateUserCommand (user)); 78 | return Ok (userResponse); 79 | } 80 | 81 | /// 82 | /// Updates a user 83 | /// 84 | /// 85 | /// Sample request: 86 | /// 87 | /// { 88 | /// "id": 0, 89 | /// "firstName": "Maniruzzaman", 90 | /// "lastName": "Akash", 91 | /// "userName": "maniruzzaman", 92 | /// "email": "maniruzzamanAkash@gmail.com", 93 | /// "phoneNo": "01951233084", 94 | /// "password": "123456", 95 | /// "avatar": "string", 96 | /// "gender": true 97 | /// } 98 | /// 99 | /// 100 | /// A newly updated User Item 101 | /// Returns the newly updated user 102 | /// If any of the field is null 103 | /// If user id not found 104 | [Authorize] 105 | [HttpPut ("{id}", Name = "UpdateUser")] 106 | public async Task UpdateUser (int id, User user) { 107 | var userSearchByID = await _mediator.Send (new GetSingleUserQuery (id)); 108 | if (userSearchByID == null) 109 | return NotFound (); 110 | 111 | var userResponse = await _mediator.Send (new UpdateUserCommand (user)); 112 | return Ok (userResponse); 113 | } 114 | 115 | /// 116 | /// Deletes a user 117 | /// 118 | /// Deleted User Item 119 | /// Returns the newly deleted user 120 | /// If any of the field is null 121 | /// If user id not found 122 | [Authorize] 123 | [HttpDelete ("{id}", Name = "DeleteUser")] 124 | public async Task DeleteUser (int id) { 125 | var userSearchByID = await _mediator.Send (new GetSingleUserQuery (id)); 126 | if (userSearchByID == null) 127 | return NotFound (); 128 | 129 | var userResponse = await _mediator.Send (new DeleteUserCommand (userSearchByID)); 130 | return Ok (userResponse); 131 | } 132 | } 133 | } -------------------------------------------------------------------------------- /Controllers/WeatherForecastController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.Extensions.Logging; 7 | 8 | namespace APIFuelStation.Controllers 9 | { 10 | [ApiController] 11 | [Route("[controller]")] 12 | public class WeatherForecastController : ControllerBase 13 | { 14 | private static readonly string[] Summaries = new[] 15 | { 16 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" 17 | }; 18 | 19 | private readonly ILogger _logger; 20 | 21 | public WeatherForecastController(ILogger logger) 22 | { 23 | _logger = logger; 24 | } 25 | 26 | [HttpGet] 27 | public IEnumerable Get() 28 | { 29 | var rng = new Random(); 30 | return Enumerable.Range(1, 5).Select(index => new WeatherForecast 31 | { 32 | Date = DateTime.Now.AddDays(index), 33 | TemperatureC = rng.Next(-20, 55), 34 | Summary = Summaries[rng.Next(Summaries.Length)] 35 | }) 36 | .ToArray(); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /DbContexts/FuelDBContext.cs: -------------------------------------------------------------------------------- 1 | using APIFuelStation.Models; 2 | using Microsoft.EntityFrameworkCore; 3 | 4 | namespace APIFuelStation.DbContexts { 5 | public class FuelDBContext : DbContext { 6 | 7 | public FuelDBContext (DbContextOptions opt) : base (opt) { 8 | 9 | } 10 | 11 | // public DbSet Commands { get; set; } 12 | public DbSet Users { get; set; } 13 | public DbSet Departments { get; set; } 14 | public DbSet Designations { get; set; } 15 | public DbSet Employees { get; set; } 16 | 17 | // Keys 18 | protected override void OnModelCreating (ModelBuilder modelBuilder) { 19 | // User Model 20 | modelBuilder.Entity () 21 | .HasIndex (user => user.Email) 22 | .IsUnique (); 23 | modelBuilder.Entity () 24 | .HasIndex (user => user.PhoneNo) 25 | .IsUnique (); 26 | modelBuilder.Entity () 27 | .HasIndex (user => user.UserName) 28 | .IsUnique (); 29 | 30 | // Department Model 31 | modelBuilder.Entity () 32 | .HasIndex (department => department.Code) 33 | .IsUnique (); 34 | 35 | // Designation Model 36 | modelBuilder.Entity () 37 | .HasIndex (designation => designation.Code) 38 | .IsUnique (); 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /IRepositories/IAuthRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using APIFuelStation.Models; 4 | 5 | namespace APIFuelStation.IRepositories { 6 | public interface IAuthRepository { 7 | bool SaveChanges (); 8 | 9 | Task Register (User user); 10 | Task Login (User user); 11 | } 12 | } -------------------------------------------------------------------------------- /IRepositories/IDepartmentRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using APIFuelStation.Models; 4 | 5 | namespace APIFuelStation.IRepositories 6 | { 7 | public interface IDepartmentRepository 8 | { 9 | 10 | List GetAllDepartments(); 11 | Department GetDepartmentById(int id); 12 | Department GetDepartmentByCode(string code); 13 | Task CreateDepartment(Department department); 14 | Task UpdateDepartment(Department department); 15 | Task DeleteDepartment(Department department); 16 | 17 | } 18 | } -------------------------------------------------------------------------------- /IRepositories/IDesignationRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using APIFuelStation.Models; 4 | 5 | namespace APIFuelStation.IRepositories 6 | { 7 | public interface IDesignationRepository 8 | { 9 | 10 | List GetAllDesignations(); 11 | Designation GetDesignationById(int id); 12 | Designation GetDesignationByCode(string code); 13 | Task CreateDesignation(Designation designation); 14 | Task UpdateDesignation(Designation designation); 15 | Task DeleteDesignation(Designation designation); 16 | 17 | } 18 | } -------------------------------------------------------------------------------- /IRepositories/IEmployeeRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using APIFuelStation.Models; 4 | 5 | namespace APIFuelStation.IRepositories { 6 | public interface IEmployeeRepository { 7 | 8 | List GetAllEmployees (); 9 | Employee GetEmployeeById (int id); 10 | Employee GetEmployeeByEmail (string email); 11 | Employee GetEmployeeByEmployeeName (string userName); 12 | Employee GetEmployeeByPhoneNo (string phoneNo); 13 | Task CreateEmployee (Employee user); 14 | Task UpdateEmployee (Employee user); 15 | Task DeleteEmployee (Employee user); 16 | 17 | } 18 | } -------------------------------------------------------------------------------- /IRepositories/IUserRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using APIFuelStation.Models; 4 | 5 | namespace APIFuelStation.IRepositories { 6 | public interface IUserRepository { 7 | 8 | List GetAllUsers (); 9 | User GetUserById (int id); 10 | User GetUserByEmail (string email); 11 | User GetUserByUserName (string userName); 12 | User GetUserByPhoneNo (string phoneNo); 13 | Task CreateUser (User user); 14 | Task UpdateUser (User user); 15 | Task DeleteUser (User user); 16 | 17 | } 18 | } -------------------------------------------------------------------------------- /Migrations/20200619131033_UserTableMigration.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | using APIFuelStation.DbContexts; 3 | using Microsoft.EntityFrameworkCore; 4 | using Microsoft.EntityFrameworkCore.Infrastructure; 5 | using Microsoft.EntityFrameworkCore.Metadata; 6 | using Microsoft.EntityFrameworkCore.Migrations; 7 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion; 8 | 9 | namespace APIFuelStation.Migrations 10 | { 11 | [DbContext(typeof(FuelDBContext))] 12 | [Migration("20200619131033_UserTableMigration")] 13 | partial class UserTableMigration 14 | { 15 | protected override void BuildTargetModel(ModelBuilder modelBuilder) 16 | { 17 | #pragma warning disable 612, 618 18 | modelBuilder 19 | .HasAnnotation("ProductVersion", "3.1.5") 20 | .HasAnnotation("Relational:MaxIdentifierLength", 128) 21 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 22 | 23 | modelBuilder.Entity("APIFuelStation.Models.User", b => 24 | { 25 | b.Property("Id") 26 | .ValueGeneratedOnAdd() 27 | .HasColumnType("int") 28 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 29 | 30 | b.Property("Avatar") 31 | .IsRequired() 32 | .HasColumnType("nvarchar(250)") 33 | .HasMaxLength(250); 34 | 35 | b.Property("Email") 36 | .IsRequired() 37 | .HasColumnType("nvarchar(100)") 38 | .HasMaxLength(100); 39 | 40 | b.Property("FirstName") 41 | .IsRequired() 42 | .HasColumnType("nvarchar(50)") 43 | .HasMaxLength(50); 44 | 45 | b.Property("Gender") 46 | .HasColumnType("bit"); 47 | 48 | b.Property("LastName") 49 | .IsRequired() 50 | .HasColumnType("nvarchar(30)") 51 | .HasMaxLength(30); 52 | 53 | b.Property("Password") 54 | .IsRequired() 55 | .HasColumnType("nvarchar(100)") 56 | .HasMaxLength(100); 57 | 58 | b.Property("PhoneNo") 59 | .IsRequired() 60 | .HasColumnType("nvarchar(15)") 61 | .HasMaxLength(15); 62 | 63 | b.Property("UserName") 64 | .IsRequired() 65 | .HasColumnType("nvarchar(50)") 66 | .HasMaxLength(50); 67 | 68 | b.HasKey("Id"); 69 | 70 | b.ToTable("Users"); 71 | }); 72 | #pragma warning restore 612, 618 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Migrations/20200619131033_UserTableMigration.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace APIFuelStation.Migrations 4 | { 5 | public partial class UserTableMigration : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | migrationBuilder.CreateTable( 10 | name: "Users", 11 | columns: table => new 12 | { 13 | Id = table.Column(nullable: false) 14 | .Annotation("SqlServer:Identity", "1, 1"), 15 | FirstName = table.Column(maxLength: 50, nullable: false), 16 | LastName = table.Column(maxLength: 30, nullable: false), 17 | UserName = table.Column(maxLength: 50, nullable: false), 18 | Email = table.Column(maxLength: 100, nullable: false), 19 | PhoneNo = table.Column(maxLength: 15, nullable: false), 20 | Password = table.Column(maxLength: 100, nullable: false), 21 | Avatar = table.Column(maxLength: 250, nullable: false), 22 | Gender = table.Column(nullable: false) 23 | }, 24 | constraints: table => 25 | { 26 | table.PrimaryKey("PK_Users", x => x.Id); 27 | }); 28 | } 29 | 30 | protected override void Down(MigrationBuilder migrationBuilder) 31 | { 32 | migrationBuilder.DropTable( 33 | name: "Users"); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Migrations/20200620044643_UniqueEmail.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | using APIFuelStation.DbContexts; 3 | using Microsoft.EntityFrameworkCore; 4 | using Microsoft.EntityFrameworkCore.Infrastructure; 5 | using Microsoft.EntityFrameworkCore.Metadata; 6 | using Microsoft.EntityFrameworkCore.Migrations; 7 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion; 8 | 9 | namespace APIFuelStation.Migrations 10 | { 11 | [DbContext(typeof(FuelDBContext))] 12 | [Migration("20200620044643_UniqueEmail")] 13 | partial class UniqueEmail 14 | { 15 | protected override void BuildTargetModel(ModelBuilder modelBuilder) 16 | { 17 | #pragma warning disable 612, 618 18 | modelBuilder 19 | .HasAnnotation("ProductVersion", "3.1.5") 20 | .HasAnnotation("Relational:MaxIdentifierLength", 128) 21 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 22 | 23 | modelBuilder.Entity("APIFuelStation.Models.User", b => 24 | { 25 | b.Property("Id") 26 | .ValueGeneratedOnAdd() 27 | .HasColumnType("int") 28 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 29 | 30 | b.Property("Avatar") 31 | .IsRequired() 32 | .HasColumnType("nvarchar(250)") 33 | .HasMaxLength(250); 34 | 35 | b.Property("Email") 36 | .IsRequired() 37 | .HasColumnType("nvarchar(100)") 38 | .HasMaxLength(100); 39 | 40 | b.Property("FirstName") 41 | .IsRequired() 42 | .HasColumnType("nvarchar(50)") 43 | .HasMaxLength(50); 44 | 45 | b.Property("Gender") 46 | .HasColumnType("bit"); 47 | 48 | b.Property("LastName") 49 | .IsRequired() 50 | .HasColumnType("nvarchar(30)") 51 | .HasMaxLength(30); 52 | 53 | b.Property("Password") 54 | .IsRequired() 55 | .HasColumnType("nvarchar(100)") 56 | .HasMaxLength(100); 57 | 58 | b.Property("PhoneNo") 59 | .IsRequired() 60 | .HasColumnType("nvarchar(15)") 61 | .HasMaxLength(15); 62 | 63 | b.Property("UserName") 64 | .IsRequired() 65 | .HasColumnType("nvarchar(50)") 66 | .HasMaxLength(50); 67 | 68 | b.HasKey("Id"); 69 | 70 | b.HasIndex("Email") 71 | .IsUnique(); 72 | 73 | b.ToTable("Users"); 74 | }); 75 | #pragma warning restore 612, 618 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /Migrations/20200620044643_UniqueEmail.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace APIFuelStation.Migrations 4 | { 5 | public partial class UniqueEmail : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | migrationBuilder.CreateIndex( 10 | name: "IX_Users_Email", 11 | table: "Users", 12 | column: "Email", 13 | unique: true); 14 | } 15 | 16 | protected override void Down(MigrationBuilder migrationBuilder) 17 | { 18 | migrationBuilder.DropIndex( 19 | name: "IX_Users_Email", 20 | table: "Users"); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Migrations/20200620045532_UniquePhoneUsername.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | using APIFuelStation.DbContexts; 3 | using Microsoft.EntityFrameworkCore; 4 | using Microsoft.EntityFrameworkCore.Infrastructure; 5 | using Microsoft.EntityFrameworkCore.Metadata; 6 | using Microsoft.EntityFrameworkCore.Migrations; 7 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion; 8 | 9 | namespace APIFuelStation.Migrations 10 | { 11 | [DbContext(typeof(FuelDBContext))] 12 | [Migration("20200620045532_UniquePhoneUsername")] 13 | partial class UniquePhoneUsername 14 | { 15 | protected override void BuildTargetModel(ModelBuilder modelBuilder) 16 | { 17 | #pragma warning disable 612, 618 18 | modelBuilder 19 | .HasAnnotation("ProductVersion", "3.1.5") 20 | .HasAnnotation("Relational:MaxIdentifierLength", 128) 21 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 22 | 23 | modelBuilder.Entity("APIFuelStation.Models.User", b => 24 | { 25 | b.Property("Id") 26 | .ValueGeneratedOnAdd() 27 | .HasColumnType("int") 28 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 29 | 30 | b.Property("Avatar") 31 | .IsRequired() 32 | .HasColumnType("nvarchar(250)") 33 | .HasMaxLength(250); 34 | 35 | b.Property("Email") 36 | .IsRequired() 37 | .HasColumnType("nvarchar(100)") 38 | .HasMaxLength(100); 39 | 40 | b.Property("FirstName") 41 | .IsRequired() 42 | .HasColumnType("nvarchar(50)") 43 | .HasMaxLength(50); 44 | 45 | b.Property("Gender") 46 | .HasColumnType("bit"); 47 | 48 | b.Property("LastName") 49 | .IsRequired() 50 | .HasColumnType("nvarchar(30)") 51 | .HasMaxLength(30); 52 | 53 | b.Property("Password") 54 | .IsRequired() 55 | .HasColumnType("nvarchar(100)") 56 | .HasMaxLength(100); 57 | 58 | b.Property("PhoneNo") 59 | .IsRequired() 60 | .HasColumnType("nvarchar(15)") 61 | .HasMaxLength(15); 62 | 63 | b.Property("UserName") 64 | .IsRequired() 65 | .HasColumnType("nvarchar(50)") 66 | .HasMaxLength(50); 67 | 68 | b.HasKey("Id"); 69 | 70 | b.HasIndex("Email") 71 | .IsUnique(); 72 | 73 | b.HasIndex("PhoneNo") 74 | .IsUnique(); 75 | 76 | b.HasIndex("UserName") 77 | .IsUnique(); 78 | 79 | b.ToTable("Users"); 80 | }); 81 | #pragma warning restore 612, 618 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /Migrations/20200620045532_UniquePhoneUsername.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace APIFuelStation.Migrations 4 | { 5 | public partial class UniquePhoneUsername : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | migrationBuilder.CreateIndex( 10 | name: "IX_Users_PhoneNo", 11 | table: "Users", 12 | column: "PhoneNo", 13 | unique: true); 14 | 15 | migrationBuilder.CreateIndex( 16 | name: "IX_Users_UserName", 17 | table: "Users", 18 | column: "UserName", 19 | unique: true); 20 | } 21 | 22 | protected override void Down(MigrationBuilder migrationBuilder) 23 | { 24 | migrationBuilder.DropIndex( 25 | name: "IX_Users_PhoneNo", 26 | table: "Users"); 27 | 28 | migrationBuilder.DropIndex( 29 | name: "IX_Users_UserName", 30 | table: "Users"); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Migrations/20200620070410_DepartmentDesignationMigration.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | using APIFuelStation.DbContexts; 3 | using Microsoft.EntityFrameworkCore; 4 | using Microsoft.EntityFrameworkCore.Infrastructure; 5 | using Microsoft.EntityFrameworkCore.Metadata; 6 | using Microsoft.EntityFrameworkCore.Migrations; 7 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion; 8 | 9 | namespace APIFuelStation.Migrations 10 | { 11 | [DbContext(typeof(FuelDBContext))] 12 | [Migration("20200620070410_DepartmentDesignationMigration")] 13 | partial class DepartmentDesignationMigration 14 | { 15 | protected override void BuildTargetModel(ModelBuilder modelBuilder) 16 | { 17 | #pragma warning disable 612, 618 18 | modelBuilder 19 | .HasAnnotation("ProductVersion", "3.1.5") 20 | .HasAnnotation("Relational:MaxIdentifierLength", 128) 21 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 22 | 23 | modelBuilder.Entity("APIFuelStation.Models.Department", b => 24 | { 25 | b.Property("Id") 26 | .ValueGeneratedOnAdd() 27 | .HasColumnType("int") 28 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 29 | 30 | b.Property("Code") 31 | .HasColumnType("nvarchar(100)") 32 | .HasMaxLength(100); 33 | 34 | b.Property("Description") 35 | .HasColumnType("nvarchar(max)"); 36 | 37 | b.Property("Name") 38 | .IsRequired() 39 | .HasColumnType("nvarchar(100)") 40 | .HasMaxLength(100); 41 | 42 | b.HasKey("Id"); 43 | 44 | b.HasIndex("Code") 45 | .IsUnique() 46 | .HasFilter("[Code] IS NOT NULL"); 47 | 48 | b.ToTable("Departments"); 49 | }); 50 | 51 | modelBuilder.Entity("APIFuelStation.Models.Designation", b => 52 | { 53 | b.Property("Id") 54 | .ValueGeneratedOnAdd() 55 | .HasColumnType("int") 56 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 57 | 58 | b.Property("Code") 59 | .HasColumnType("nvarchar(100)") 60 | .HasMaxLength(100); 61 | 62 | b.Property("Description") 63 | .HasColumnType("nvarchar(max)"); 64 | 65 | b.Property("Name") 66 | .IsRequired() 67 | .HasColumnType("nvarchar(100)") 68 | .HasMaxLength(100); 69 | 70 | b.HasKey("Id"); 71 | 72 | b.HasIndex("Code") 73 | .IsUnique() 74 | .HasFilter("[Code] IS NOT NULL"); 75 | 76 | b.ToTable("Designations"); 77 | }); 78 | 79 | modelBuilder.Entity("APIFuelStation.Models.User", b => 80 | { 81 | b.Property("Id") 82 | .ValueGeneratedOnAdd() 83 | .HasColumnType("int") 84 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 85 | 86 | b.Property("Avatar") 87 | .IsRequired() 88 | .HasColumnType("nvarchar(250)") 89 | .HasMaxLength(250); 90 | 91 | b.Property("Email") 92 | .IsRequired() 93 | .HasColumnType("nvarchar(100)") 94 | .HasMaxLength(100); 95 | 96 | b.Property("FirstName") 97 | .IsRequired() 98 | .HasColumnType("nvarchar(50)") 99 | .HasMaxLength(50); 100 | 101 | b.Property("Gender") 102 | .HasColumnType("bit"); 103 | 104 | b.Property("LastName") 105 | .IsRequired() 106 | .HasColumnType("nvarchar(30)") 107 | .HasMaxLength(30); 108 | 109 | b.Property("Password") 110 | .IsRequired() 111 | .HasColumnType("nvarchar(100)") 112 | .HasMaxLength(100); 113 | 114 | b.Property("PhoneNo") 115 | .IsRequired() 116 | .HasColumnType("nvarchar(15)") 117 | .HasMaxLength(15); 118 | 119 | b.Property("UserName") 120 | .IsRequired() 121 | .HasColumnType("nvarchar(50)") 122 | .HasMaxLength(50); 123 | 124 | b.HasKey("Id"); 125 | 126 | b.HasIndex("Email") 127 | .IsUnique(); 128 | 129 | b.HasIndex("PhoneNo") 130 | .IsUnique(); 131 | 132 | b.HasIndex("UserName") 133 | .IsUnique(); 134 | 135 | b.ToTable("Users"); 136 | }); 137 | #pragma warning restore 612, 618 138 | } 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /Migrations/20200620070410_DepartmentDesignationMigration.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace APIFuelStation.Migrations 4 | { 5 | public partial class DepartmentDesignationMigration : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | migrationBuilder.CreateTable( 10 | name: "Departments", 11 | columns: table => new 12 | { 13 | Id = table.Column(nullable: false) 14 | .Annotation("SqlServer:Identity", "1, 1"), 15 | Name = table.Column(maxLength: 100, nullable: false), 16 | Code = table.Column(maxLength: 100, nullable: true), 17 | Description = table.Column(nullable: true) 18 | }, 19 | constraints: table => 20 | { 21 | table.PrimaryKey("PK_Departments", x => x.Id); 22 | }); 23 | 24 | migrationBuilder.CreateTable( 25 | name: "Designations", 26 | columns: table => new 27 | { 28 | Id = table.Column(nullable: false) 29 | .Annotation("SqlServer:Identity", "1, 1"), 30 | Name = table.Column(maxLength: 100, nullable: false), 31 | Code = table.Column(maxLength: 100, nullable: true), 32 | Description = table.Column(nullable: true) 33 | }, 34 | constraints: table => 35 | { 36 | table.PrimaryKey("PK_Designations", x => x.Id); 37 | }); 38 | 39 | migrationBuilder.CreateIndex( 40 | name: "IX_Departments_Code", 41 | table: "Departments", 42 | column: "Code", 43 | unique: true, 44 | filter: "[Code] IS NOT NULL"); 45 | 46 | migrationBuilder.CreateIndex( 47 | name: "IX_Designations_Code", 48 | table: "Designations", 49 | column: "Code", 50 | unique: true, 51 | filter: "[Code] IS NOT NULL"); 52 | } 53 | 54 | protected override void Down(MigrationBuilder migrationBuilder) 55 | { 56 | migrationBuilder.DropTable( 57 | name: "Departments"); 58 | 59 | migrationBuilder.DropTable( 60 | name: "Designations"); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Migrations/20200623152632_EmployeeMigration.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | using System; 3 | using APIFuelStation.DbContexts; 4 | using Microsoft.EntityFrameworkCore; 5 | using Microsoft.EntityFrameworkCore.Infrastructure; 6 | using Microsoft.EntityFrameworkCore.Metadata; 7 | using Microsoft.EntityFrameworkCore.Migrations; 8 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion; 9 | 10 | namespace APIFuelStation.Migrations 11 | { 12 | [DbContext(typeof(FuelDBContext))] 13 | [Migration("20200623152632_EmployeeMigration")] 14 | partial class EmployeeMigration 15 | { 16 | protected override void BuildTargetModel(ModelBuilder modelBuilder) 17 | { 18 | #pragma warning disable 612, 618 19 | modelBuilder 20 | .HasAnnotation("ProductVersion", "3.1.5") 21 | .HasAnnotation("Relational:MaxIdentifierLength", 128) 22 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 23 | 24 | modelBuilder.Entity("APIFuelStation.Models.Department", b => 25 | { 26 | b.Property("Id") 27 | .ValueGeneratedOnAdd() 28 | .HasColumnType("int") 29 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 30 | 31 | b.Property("Code") 32 | .HasColumnType("nvarchar(100)") 33 | .HasMaxLength(100); 34 | 35 | b.Property("Description") 36 | .HasColumnType("nvarchar(max)"); 37 | 38 | b.Property("Name") 39 | .IsRequired() 40 | .HasColumnType("nvarchar(100)") 41 | .HasMaxLength(100); 42 | 43 | b.HasKey("Id"); 44 | 45 | b.HasIndex("Code") 46 | .IsUnique() 47 | .HasFilter("[Code] IS NOT NULL"); 48 | 49 | b.ToTable("Departments"); 50 | }); 51 | 52 | modelBuilder.Entity("APIFuelStation.Models.Designation", b => 53 | { 54 | b.Property("Id") 55 | .ValueGeneratedOnAdd() 56 | .HasColumnType("int") 57 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 58 | 59 | b.Property("Code") 60 | .HasColumnType("nvarchar(100)") 61 | .HasMaxLength(100); 62 | 63 | b.Property("Description") 64 | .HasColumnType("nvarchar(max)"); 65 | 66 | b.Property("Name") 67 | .IsRequired() 68 | .HasColumnType("nvarchar(100)") 69 | .HasMaxLength(100); 70 | 71 | b.HasKey("Id"); 72 | 73 | b.HasIndex("Code") 74 | .IsUnique() 75 | .HasFilter("[Code] IS NOT NULL"); 76 | 77 | b.ToTable("Designations"); 78 | }); 79 | 80 | modelBuilder.Entity("APIFuelStation.Models.Employee", b => 81 | { 82 | b.Property("Id") 83 | .ValueGeneratedOnAdd() 84 | .HasColumnType("int") 85 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 86 | 87 | b.Property("Avatar") 88 | .HasColumnType("nvarchar(250)") 89 | .HasMaxLength(250); 90 | 91 | b.Property("DepartmentId") 92 | .HasColumnType("int"); 93 | 94 | b.Property("DesignationId") 95 | .HasColumnType("int"); 96 | 97 | b.Property("Email") 98 | .IsRequired() 99 | .HasColumnType("nvarchar(100)") 100 | .HasMaxLength(100); 101 | 102 | b.Property("FirstName") 103 | .IsRequired() 104 | .HasColumnType("nvarchar(50)") 105 | .HasMaxLength(50); 106 | 107 | b.Property("Gender") 108 | .HasColumnType("bit"); 109 | 110 | b.Property("JoiningDate") 111 | .HasColumnType("nvarchar(max)"); 112 | 113 | b.Property("LastName") 114 | .IsRequired() 115 | .HasColumnType("nvarchar(30)") 116 | .HasMaxLength(30); 117 | 118 | b.Property("Password") 119 | .HasColumnType("nvarchar(100)") 120 | .HasMaxLength(100); 121 | 122 | b.Property("PhoneNo") 123 | .IsRequired() 124 | .HasColumnType("nvarchar(15)") 125 | .HasMaxLength(15); 126 | 127 | b.Property("UserName") 128 | .IsRequired() 129 | .HasColumnType("nvarchar(50)") 130 | .HasMaxLength(50); 131 | 132 | b.HasKey("Id"); 133 | 134 | b.HasIndex("DepartmentId"); 135 | 136 | b.HasIndex("DesignationId"); 137 | 138 | b.ToTable("Employees"); 139 | }); 140 | 141 | modelBuilder.Entity("APIFuelStation.Models.User", b => 142 | { 143 | b.Property("Id") 144 | .ValueGeneratedOnAdd() 145 | .HasColumnType("int") 146 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 147 | 148 | b.Property("Avatar") 149 | .IsRequired() 150 | .HasColumnType("nvarchar(250)") 151 | .HasMaxLength(250); 152 | 153 | b.Property("Email") 154 | .IsRequired() 155 | .HasColumnType("nvarchar(100)") 156 | .HasMaxLength(100); 157 | 158 | b.Property("FirstName") 159 | .IsRequired() 160 | .HasColumnType("nvarchar(50)") 161 | .HasMaxLength(50); 162 | 163 | b.Property("Gender") 164 | .HasColumnType("bit"); 165 | 166 | b.Property("LastName") 167 | .IsRequired() 168 | .HasColumnType("nvarchar(30)") 169 | .HasMaxLength(30); 170 | 171 | b.Property("Password") 172 | .IsRequired() 173 | .HasColumnType("nvarchar(100)") 174 | .HasMaxLength(100); 175 | 176 | b.Property("PhoneNo") 177 | .IsRequired() 178 | .HasColumnType("nvarchar(15)") 179 | .HasMaxLength(15); 180 | 181 | b.Property("UserName") 182 | .IsRequired() 183 | .HasColumnType("nvarchar(50)") 184 | .HasMaxLength(50); 185 | 186 | b.HasKey("Id"); 187 | 188 | b.HasIndex("Email") 189 | .IsUnique(); 190 | 191 | b.HasIndex("PhoneNo") 192 | .IsUnique(); 193 | 194 | b.HasIndex("UserName") 195 | .IsUnique(); 196 | 197 | b.ToTable("Users"); 198 | }); 199 | 200 | modelBuilder.Entity("APIFuelStation.Models.Employee", b => 201 | { 202 | b.HasOne("APIFuelStation.Models.Department", "Department") 203 | .WithMany() 204 | .HasForeignKey("DepartmentId"); 205 | 206 | b.HasOne("APIFuelStation.Models.Designation", "Designation") 207 | .WithMany() 208 | .HasForeignKey("DesignationId"); 209 | }); 210 | #pragma warning restore 612, 618 211 | } 212 | } 213 | } 214 | -------------------------------------------------------------------------------- /Migrations/20200623152632_EmployeeMigration.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace APIFuelStation.Migrations 4 | { 5 | public partial class EmployeeMigration : Migration 6 | { 7 | protected override void Up(MigrationBuilder migrationBuilder) 8 | { 9 | migrationBuilder.CreateTable( 10 | name: "Employees", 11 | columns: table => new 12 | { 13 | Id = table.Column(nullable: false) 14 | .Annotation("SqlServer:Identity", "1, 1"), 15 | FirstName = table.Column(maxLength: 50, nullable: false), 16 | LastName = table.Column(maxLength: 30, nullable: false), 17 | UserName = table.Column(maxLength: 50, nullable: false), 18 | Email = table.Column(maxLength: 100, nullable: false), 19 | PhoneNo = table.Column(maxLength: 15, nullable: false), 20 | Gender = table.Column(nullable: false), 21 | Password = table.Column(maxLength: 100, nullable: true), 22 | Avatar = table.Column(maxLength: 250, nullable: true), 23 | JoiningDate = table.Column(nullable: true), 24 | DesignationId = table.Column(nullable: true), 25 | DepartmentId = table.Column(nullable: true) 26 | }, 27 | constraints: table => 28 | { 29 | table.PrimaryKey("PK_Employees", x => x.Id); 30 | table.ForeignKey( 31 | name: "FK_Employees_Departments_DepartmentId", 32 | column: x => x.DepartmentId, 33 | principalTable: "Departments", 34 | principalColumn: "Id", 35 | onDelete: ReferentialAction.Restrict); 36 | table.ForeignKey( 37 | name: "FK_Employees_Designations_DesignationId", 38 | column: x => x.DesignationId, 39 | principalTable: "Designations", 40 | principalColumn: "Id", 41 | onDelete: ReferentialAction.Restrict); 42 | }); 43 | 44 | migrationBuilder.CreateIndex( 45 | name: "IX_Employees_DepartmentId", 46 | table: "Employees", 47 | column: "DepartmentId"); 48 | 49 | migrationBuilder.CreateIndex( 50 | name: "IX_Employees_DesignationId", 51 | table: "Employees", 52 | column: "DesignationId"); 53 | } 54 | 55 | protected override void Down(MigrationBuilder migrationBuilder) 56 | { 57 | migrationBuilder.DropTable( 58 | name: "Employees"); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Migrations/FuelDBContextModelSnapshot.cs: -------------------------------------------------------------------------------- 1 | // 2 | using System; 3 | using APIFuelStation.DbContexts; 4 | using Microsoft.EntityFrameworkCore; 5 | using Microsoft.EntityFrameworkCore.Infrastructure; 6 | using Microsoft.EntityFrameworkCore.Metadata; 7 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion; 8 | 9 | namespace APIFuelStation.Migrations 10 | { 11 | [DbContext(typeof(FuelDBContext))] 12 | partial class FuelDBContextModelSnapshot : ModelSnapshot 13 | { 14 | protected override void BuildModel(ModelBuilder modelBuilder) 15 | { 16 | #pragma warning disable 612, 618 17 | modelBuilder 18 | .HasAnnotation("ProductVersion", "3.1.5") 19 | .HasAnnotation("Relational:MaxIdentifierLength", 128) 20 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 21 | 22 | modelBuilder.Entity("APIFuelStation.Models.Department", b => 23 | { 24 | b.Property("Id") 25 | .ValueGeneratedOnAdd() 26 | .HasColumnType("int") 27 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 28 | 29 | b.Property("Code") 30 | .HasColumnType("nvarchar(100)") 31 | .HasMaxLength(100); 32 | 33 | b.Property("Description") 34 | .HasColumnType("nvarchar(max)"); 35 | 36 | b.Property("Name") 37 | .IsRequired() 38 | .HasColumnType("nvarchar(100)") 39 | .HasMaxLength(100); 40 | 41 | b.HasKey("Id"); 42 | 43 | b.HasIndex("Code") 44 | .IsUnique() 45 | .HasFilter("[Code] IS NOT NULL"); 46 | 47 | b.ToTable("Departments"); 48 | }); 49 | 50 | modelBuilder.Entity("APIFuelStation.Models.Designation", b => 51 | { 52 | b.Property("Id") 53 | .ValueGeneratedOnAdd() 54 | .HasColumnType("int") 55 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 56 | 57 | b.Property("Code") 58 | .HasColumnType("nvarchar(100)") 59 | .HasMaxLength(100); 60 | 61 | b.Property("Description") 62 | .HasColumnType("nvarchar(max)"); 63 | 64 | b.Property("Name") 65 | .IsRequired() 66 | .HasColumnType("nvarchar(100)") 67 | .HasMaxLength(100); 68 | 69 | b.HasKey("Id"); 70 | 71 | b.HasIndex("Code") 72 | .IsUnique() 73 | .HasFilter("[Code] IS NOT NULL"); 74 | 75 | b.ToTable("Designations"); 76 | }); 77 | 78 | modelBuilder.Entity("APIFuelStation.Models.Employee", b => 79 | { 80 | b.Property("Id") 81 | .ValueGeneratedOnAdd() 82 | .HasColumnType("int") 83 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 84 | 85 | b.Property("Avatar") 86 | .HasColumnType("nvarchar(250)") 87 | .HasMaxLength(250); 88 | 89 | b.Property("DepartmentId") 90 | .HasColumnType("int"); 91 | 92 | b.Property("DesignationId") 93 | .HasColumnType("int"); 94 | 95 | b.Property("Email") 96 | .IsRequired() 97 | .HasColumnType("nvarchar(100)") 98 | .HasMaxLength(100); 99 | 100 | b.Property("FirstName") 101 | .IsRequired() 102 | .HasColumnType("nvarchar(50)") 103 | .HasMaxLength(50); 104 | 105 | b.Property("Gender") 106 | .HasColumnType("bit"); 107 | 108 | b.Property("JoiningDate") 109 | .HasColumnType("nvarchar(max)"); 110 | 111 | b.Property("LastName") 112 | .IsRequired() 113 | .HasColumnType("nvarchar(30)") 114 | .HasMaxLength(30); 115 | 116 | b.Property("Password") 117 | .HasColumnType("nvarchar(100)") 118 | .HasMaxLength(100); 119 | 120 | b.Property("PhoneNo") 121 | .IsRequired() 122 | .HasColumnType("nvarchar(15)") 123 | .HasMaxLength(15); 124 | 125 | b.Property("UserName") 126 | .IsRequired() 127 | .HasColumnType("nvarchar(50)") 128 | .HasMaxLength(50); 129 | 130 | b.HasKey("Id"); 131 | 132 | b.HasIndex("DepartmentId"); 133 | 134 | b.HasIndex("DesignationId"); 135 | 136 | b.ToTable("Employees"); 137 | }); 138 | 139 | modelBuilder.Entity("APIFuelStation.Models.User", b => 140 | { 141 | b.Property("Id") 142 | .ValueGeneratedOnAdd() 143 | .HasColumnType("int") 144 | .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); 145 | 146 | b.Property("Avatar") 147 | .IsRequired() 148 | .HasColumnType("nvarchar(250)") 149 | .HasMaxLength(250); 150 | 151 | b.Property("Email") 152 | .IsRequired() 153 | .HasColumnType("nvarchar(100)") 154 | .HasMaxLength(100); 155 | 156 | b.Property("FirstName") 157 | .IsRequired() 158 | .HasColumnType("nvarchar(50)") 159 | .HasMaxLength(50); 160 | 161 | b.Property("Gender") 162 | .HasColumnType("bit"); 163 | 164 | b.Property("LastName") 165 | .IsRequired() 166 | .HasColumnType("nvarchar(30)") 167 | .HasMaxLength(30); 168 | 169 | b.Property("Password") 170 | .IsRequired() 171 | .HasColumnType("nvarchar(100)") 172 | .HasMaxLength(100); 173 | 174 | b.Property("PhoneNo") 175 | .IsRequired() 176 | .HasColumnType("nvarchar(15)") 177 | .HasMaxLength(15); 178 | 179 | b.Property("UserName") 180 | .IsRequired() 181 | .HasColumnType("nvarchar(50)") 182 | .HasMaxLength(50); 183 | 184 | b.HasKey("Id"); 185 | 186 | b.HasIndex("Email") 187 | .IsUnique(); 188 | 189 | b.HasIndex("PhoneNo") 190 | .IsUnique(); 191 | 192 | b.HasIndex("UserName") 193 | .IsUnique(); 194 | 195 | b.ToTable("Users"); 196 | }); 197 | 198 | modelBuilder.Entity("APIFuelStation.Models.Employee", b => 199 | { 200 | b.HasOne("APIFuelStation.Models.Department", "Department") 201 | .WithMany() 202 | .HasForeignKey("DepartmentId"); 203 | 204 | b.HasOne("APIFuelStation.Models.Designation", "Designation") 205 | .WithMany() 206 | .HasForeignKey("DesignationId"); 207 | }); 208 | #pragma warning restore 612, 618 209 | } 210 | } 211 | } 212 | -------------------------------------------------------------------------------- /Models/Department.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace APIFuelStation.Models 5 | { 6 | public class Department 7 | { 8 | [Key] 9 | public int Id { get; set; } 10 | 11 | [Required] 12 | [MaxLength(100)] 13 | public string Name { get; set; } 14 | 15 | [MaxLength(100)] 16 | public string? Code { get; set; } 17 | 18 | public string? Description { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /Models/Designation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel.DataAnnotations; 3 | 4 | namespace APIFuelStation.Models { 5 | public class Designation { 6 | [Key] 7 | public int Id { get; set; } 8 | 9 | [Required] 10 | [MaxLength (100)] 11 | public string Name { get; set; } 12 | 13 | [MaxLength (100)] 14 | public string? Code { get; set; } 15 | 16 | public string? Description { get; set; } 17 | 18 | } 19 | } -------------------------------------------------------------------------------- /Models/Employee.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace APIFuelStation.Models { 4 | public class Employee { 5 | [Key] 6 | public int Id { get; set; } 7 | 8 | [Required] 9 | [MaxLength (50)] 10 | public string FirstName { get; set; } 11 | 12 | [Required] 13 | [MaxLength (30)] 14 | public string LastName { get; set; } 15 | 16 | [Required] 17 | [MaxLength (50)] 18 | public string UserName { get; set; } 19 | 20 | [Required] 21 | [MaxLength (100)] 22 | public string Email { get; set; } 23 | 24 | [Required] 25 | [MaxLength (15)] 26 | public string PhoneNo { get; set; } 27 | 28 | [Required] 29 | public bool Gender { get; set; } 30 | 31 | [MaxLength (100)] 32 | public string? Password { get; set; } 33 | 34 | [MaxLength (250)] 35 | public string? Avatar { get; set; } 36 | 37 | [DataType (DataType.Date)] 38 | [DisplayFormat (DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)] 39 | public string? JoiningDate { get; set; } 40 | 41 | public int? DesignationId { get; set; } 42 | public int? DepartmentId { get; set; } 43 | // public Department Department { get; set; } 44 | // public Designation Designation { get; set; } 45 | } 46 | } -------------------------------------------------------------------------------- /Models/User.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace APIFuelStation.Models { 4 | public class User { 5 | [Key] 6 | public int Id { get; set; } 7 | 8 | [Required] 9 | [MaxLength (50)] 10 | public string FirstName { get; set; } 11 | 12 | [Required] 13 | [MaxLength (30)] 14 | public string LastName { get; set; } 15 | 16 | [Required] 17 | [MaxLength (50)] 18 | public string UserName { get; set; } 19 | 20 | [Required] 21 | [MaxLength (100)] 22 | public string Email { get; set; } 23 | 24 | [Required] 25 | [MaxLength (15)] 26 | public string PhoneNo { get; set; } 27 | 28 | [Required] 29 | [MaxLength (100)] 30 | public string Password { get; set; } 31 | 32 | [Required] 33 | [MaxLength (250)] 34 | public string Avatar { get; set; } 35 | 36 | [Required] 37 | public bool Gender { get; set; } 38 | } 39 | } -------------------------------------------------------------------------------- /ModelsValidator/DepartmentValidator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using APIFuelStation.IRepositories; 5 | using APIFuelStation.Models; 6 | using FluentValidation; 7 | 8 | namespace APIFuelStation.ModelsValidator { 9 | 10 | public class DepartmentValidator : AbstractValidator { 11 | 12 | private readonly IDepartmentRepository _departmentRepository; 13 | public DepartmentValidator (IDepartmentRepository departmentRepository) { 14 | _departmentRepository = departmentRepository; 15 | 16 | RuleFor (department => department.Name).NotNull ().WithMessage ("Please give department name"); 17 | RuleFor (department => department.Code).Must (IsCodeUnique).WithMessage ("Code Already Exists, Please give a new code"); 18 | } 19 | 20 | public bool IsCodeUnique (Department editedUser, string newValue) { 21 | var departmentSearchByCode = _departmentRepository.GetDepartmentByCode (newValue); 22 | if (departmentSearchByCode == null) 23 | return true; 24 | return false; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /ModelsValidator/DesignationValidator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using APIFuelStation.IRepositories; 5 | using APIFuelStation.Models; 6 | using FluentValidation; 7 | 8 | namespace APIFuelStation.ModelsValidator 9 | { 10 | 11 | public class DesignationValidator : AbstractValidator 12 | { 13 | 14 | private readonly IDesignationRepository _designationRepository; 15 | public DesignationValidator(IDesignationRepository designationRepository) 16 | { 17 | _designationRepository = designationRepository; 18 | 19 | RuleFor(designation => designation.Name).NotNull().WithMessage("Please give designation name"); 20 | RuleFor(designation => designation.Code).Must(IsCodeUnique).WithMessage("Code Already Exists, Please give a new code"); 21 | } 22 | 23 | public bool IsCodeUnique(Designation editedUser, string newValue) 24 | { 25 | var designationSearchByCode = _designationRepository.GetDesignationByCode(newValue); 26 | if (designationSearchByCode == null) 27 | return true; 28 | return false; 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /ModelsValidator/EmployeeValidator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using APIFuelStation.IRepositories; 5 | using APIFuelStation.Models; 6 | using FluentValidation; 7 | 8 | namespace APIFuelStation.ModelsValidator { 9 | 10 | public class EmployeeValidator : AbstractValidator { 11 | 12 | private readonly IEmployeeRepository _employeeRepository; 13 | public EmployeeValidator (IEmployeeRepository employeeRepository) { 14 | _employeeRepository = employeeRepository; 15 | 16 | RuleFor (employee => employee.FirstName).NotNull ().WithMessage ("Please give your first name"); 17 | RuleFor (employee => employee.LastName).NotNull ().WithMessage ("Please give your last name"); 18 | RuleFor (employee => employee.PhoneNo).Length (11).WithMessage ("Please give your phone number of 11 digits"); 19 | RuleFor (employee => employee.Email).NotNull ().EmailAddress ().WithMessage ("Please give your valid email address"); 20 | RuleFor (employee => employee.Email).Must (IsEmailUnique).WithMessage ("Email already exists, Please give a new email address"); 21 | } 22 | 23 | public bool IsEmailUnique (Employee editedEmployee, string newValue) { 24 | var employeeSearchByEmail = _employeeRepository.GetEmployeeByEmail (newValue); 25 | if (employeeSearchByEmail == null) 26 | return true; 27 | return false; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /ModelsValidator/UserValidator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using APIFuelStation.IRepositories; 5 | using APIFuelStation.Models; 6 | using FluentValidation; 7 | 8 | namespace APIFuelStation.ModelsValidator 9 | { 10 | 11 | public class UserValidator : AbstractValidator 12 | { 13 | 14 | private readonly IUserRepository _userRepository; 15 | public UserValidator(IUserRepository userRepository) 16 | { 17 | _userRepository = userRepository; 18 | 19 | RuleFor(user => user.FirstName).NotNull().WithMessage("Please give your first name"); 20 | RuleFor(user => user.LastName).NotNull().WithMessage("Please give your last name"); 21 | RuleFor(user => user.PhoneNo).Length(11).WithMessage("Please give your phone number of 11 digits"); 22 | RuleFor(user => user.Password).MinimumLength(8).WithMessage("Please give your password at least 8 characters"); 23 | RuleFor(user => user.Email).NotNull().EmailAddress().WithMessage("Please give your valid email address"); 24 | RuleFor(user => user.Email).Must(IsEmailUnique).WithMessage("Email already exists, Please give a new email address"); 25 | } 26 | 27 | public bool IsEmailUnique(User editedUser, string newValue) 28 | { 29 | var userSearchByEmail = _userRepository.GetUserByEmail(newValue); 30 | if (userSearchByEmail == null) 31 | return true; 32 | return false; 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace APIFuelStation 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /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:34044", 8 | "sslPort": 44355 9 | } 10 | }, 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": true, 15 | "launchUrl": "weatherforecast", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "APIFuelStation": { 21 | "commandName": "Project", 22 | "launchBrowser": true, 23 | "launchUrl": "weatherforecast", 24 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 25 | "environmentVariables": { 26 | "ASPNETCORE_ENVIRONMENT": "Development" 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /QueryBus/Queries/Department/GetAllDepartmentQuery.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using APIFuelStation.Models; 3 | 4 | namespace APIFuelStation.QueryBus 5 | { 6 | public class GetAllDepartmentQuery : MediatR.IRequest> 7 | { 8 | 9 | } 10 | } -------------------------------------------------------------------------------- /QueryBus/Queries/Department/GetSingleDepartmentQuery.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using APIFuelStation.Models; 3 | 4 | namespace APIFuelStation.QueryBus 5 | { 6 | public class GetSingleDepartmentQuery : MediatR.IRequest 7 | { 8 | public GetSingleDepartmentQuery(int id) 9 | { 10 | this.Id = id; 11 | } 12 | 13 | public int Id { get; } 14 | } 15 | } -------------------------------------------------------------------------------- /QueryBus/Queries/Designation/GetAllDesignationQuery.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using APIFuelStation.Models; 3 | 4 | namespace APIFuelStation.QueryBus 5 | { 6 | public class GetAllDesignationQuery : MediatR.IRequest> 7 | { 8 | 9 | } 10 | } -------------------------------------------------------------------------------- /QueryBus/Queries/Designation/GetSingleDesignationQuery.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using APIFuelStation.Models; 3 | 4 | namespace APIFuelStation.QueryBus 5 | { 6 | public class GetSingleDesignationQuery : MediatR.IRequest 7 | { 8 | public GetSingleDesignationQuery(int id) 9 | { 10 | this.Id = id; 11 | } 12 | 13 | public int Id { get; } 14 | } 15 | } -------------------------------------------------------------------------------- /QueryBus/Queries/Employee/GetAllEmployeeQuery.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using APIFuelStation.Models; 3 | 4 | namespace APIFuelStation.QueryBus.Queries { 5 | public class GetAllEmployeeQuery : MediatR.IRequest> { 6 | 7 | } 8 | } -------------------------------------------------------------------------------- /QueryBus/Queries/Employee/GetSingleEmployeeQuery.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using APIFuelStation.Models; 3 | 4 | namespace APIFuelStation.QueryBus.Queries { 5 | public class GetSingleEmployeeQuery : MediatR.IRequest { 6 | public GetSingleEmployeeQuery (int id) { 7 | this.Id = id; 8 | } 9 | 10 | public int Id { get; } 11 | } 12 | } -------------------------------------------------------------------------------- /QueryBus/Queries/User/GetAllUserQuery.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using APIFuelStation.Models; 3 | 4 | namespace APIFuelStation.QueryBus.Queries { 5 | public class GetAllUserQuery : MediatR.IRequest> { 6 | 7 | } 8 | } -------------------------------------------------------------------------------- /QueryBus/Queries/User/GetSingleUserQuery.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using APIFuelStation.Models; 3 | 4 | namespace APIFuelStation.QueryBus.Queries { 5 | public class GetSingleUserQuery : MediatR.IRequest { 6 | public GetSingleUserQuery (int id) { 7 | this.Id = id; 8 | } 9 | 10 | public int Id { get; } 11 | } 12 | } -------------------------------------------------------------------------------- /QueryBus/QueryHandlers/Department/GetAllDepartmentHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading; 3 | using System.Threading.Tasks; 4 | using APIFuelStation.IRepositories; 5 | using APIFuelStation.Models; 6 | 7 | namespace APIFuelStation.QueryBus.Queries 8 | { 9 | public class GetAllDepartmentHandler : MediatR.IRequestHandler> 10 | { 11 | private IDepartmentRepository departmentRepository; 12 | 13 | public GetAllDepartmentHandler(IDepartmentRepository repository) 14 | { 15 | departmentRepository = repository; 16 | } 17 | 18 | public Task> Handle(GetAllDepartmentQuery request, CancellationToken cancellationToken) 19 | { 20 | return Task.Run(() => 21 | { 22 | return departmentRepository.GetAllDepartments(); 23 | }); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /QueryBus/QueryHandlers/Department/GetSingleDepartmentHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading; 3 | using System.Threading.Tasks; 4 | using APIFuelStation.IRepositories; 5 | using APIFuelStation.Models; 6 | using MediatR; 7 | 8 | namespace APIFuelStation.QueryBus.Queries 9 | { 10 | public class GetSingleDepartmentHandler : MediatR.IRequestHandler 11 | { 12 | private IDepartmentRepository departmentRepository; 13 | 14 | public GetSingleDepartmentHandler(IDepartmentRepository repository) 15 | { 16 | departmentRepository = repository; 17 | } 18 | 19 | public Task Handle(GetSingleDepartmentQuery request, CancellationToken cancellationToken) 20 | { 21 | return Task.Run(() => 22 | { 23 | var department = departmentRepository.GetDepartmentById(request.Id); 24 | if (department != null) 25 | { 26 | return department; 27 | }; 28 | return null; 29 | }); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /QueryBus/QueryHandlers/Designation/GetAllDesignationHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading; 3 | using System.Threading.Tasks; 4 | using APIFuelStation.IRepositories; 5 | using APIFuelStation.Models; 6 | 7 | namespace APIFuelStation.QueryBus.Queries 8 | { 9 | public class GetAllDesignationHandler : MediatR.IRequestHandler> 10 | { 11 | private IDesignationRepository designationRepository; 12 | 13 | public GetAllDesignationHandler(IDesignationRepository repository) 14 | { 15 | designationRepository = repository; 16 | } 17 | 18 | public Task> Handle(GetAllDesignationQuery request, CancellationToken cancellationToken) 19 | { 20 | return Task.Run(() => 21 | { 22 | return designationRepository.GetAllDesignations(); 23 | }); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /QueryBus/QueryHandlers/Designation/GetSingleDesignationHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading; 3 | using System.Threading.Tasks; 4 | using APIFuelStation.IRepositories; 5 | using APIFuelStation.Models; 6 | using MediatR; 7 | 8 | namespace APIFuelStation.QueryBus.Queries 9 | { 10 | public class GetSingleDesignationHandler : MediatR.IRequestHandler 11 | { 12 | private IDesignationRepository designationRepository; 13 | 14 | public GetSingleDesignationHandler(IDesignationRepository repository) 15 | { 16 | designationRepository = repository; 17 | } 18 | 19 | public Task Handle(GetSingleDesignationQuery request, CancellationToken cancellationToken) 20 | { 21 | return Task.Run(() => 22 | { 23 | var designation = designationRepository.GetDesignationById(request.Id); 24 | if (designation != null) 25 | { 26 | return designation; 27 | }; 28 | return null; 29 | }); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /QueryBus/QueryHandlers/Employee/GetAllEmployeeHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading; 3 | using System.Threading.Tasks; 4 | using APIFuelStation.IRepositories; 5 | using APIFuelStation.Models; 6 | 7 | namespace APIFuelStation.QueryBus.Queries { 8 | public class GetAllEmployeeHandler : MediatR.IRequestHandler> { 9 | private IEmployeeRepository employeeRepository; 10 | 11 | public GetAllEmployeeHandler (IEmployeeRepository repository) { 12 | employeeRepository = repository; 13 | } 14 | 15 | public Task> Handle (GetAllEmployeeQuery request, CancellationToken cancellationToken) { 16 | return Task.Run (() => { 17 | return employeeRepository.GetAllEmployees (); 18 | }); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /QueryBus/QueryHandlers/Employee/GetSingleEmployeeHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading; 3 | using System.Threading.Tasks; 4 | using APIFuelStation.IRepositories; 5 | using APIFuelStation.Models; 6 | using MediatR; 7 | 8 | namespace APIFuelStation.QueryBus.Queries { 9 | public class GetSingleEmployeeHandler : MediatR.IRequestHandler { 10 | private IEmployeeRepository employeeRepository; 11 | 12 | public GetSingleEmployeeHandler (IEmployeeRepository repository) { 13 | employeeRepository = repository; 14 | } 15 | 16 | public Task Handle (GetSingleEmployeeQuery request, CancellationToken cancellationToken) { 17 | return Task.Run (() => { 18 | var employee = employeeRepository.GetEmployeeById (request.Id); 19 | if (employee != null) { 20 | return employee; 21 | }; 22 | return null; 23 | }); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /QueryBus/QueryHandlers/User/GetAllUserHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading; 3 | using System.Threading.Tasks; 4 | using APIFuelStation.IRepositories; 5 | using APIFuelStation.Models; 6 | 7 | namespace APIFuelStation.QueryBus.Queries { 8 | public class GetAllUserHandler : MediatR.IRequestHandler> { 9 | private IUserRepository userRepository; 10 | 11 | public GetAllUserHandler (IUserRepository repository) { 12 | userRepository = repository; 13 | } 14 | 15 | public Task> Handle (GetAllUserQuery request, CancellationToken cancellationToken) { 16 | return Task.Run (() => { 17 | return userRepository.GetAllUsers (); 18 | }); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /QueryBus/QueryHandlers/User/GetSingleUserHandler.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading; 3 | using System.Threading.Tasks; 4 | using APIFuelStation.IRepositories; 5 | using APIFuelStation.Models; 6 | using MediatR; 7 | 8 | namespace APIFuelStation.QueryBus.Queries { 9 | public class GetSingleUserHandler : MediatR.IRequestHandler { 10 | private IUserRepository userRepository; 11 | 12 | public GetSingleUserHandler (IUserRepository repository) { 13 | userRepository = repository; 14 | } 15 | 16 | public Task Handle (GetSingleUserQuery request, CancellationToken cancellationToken) { 17 | return Task.Run (() => { 18 | var user = userRepository.GetUserById (request.Id); 19 | if (user != null) { 20 | return user; 21 | }; 22 | return null; 23 | }); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/README.md -------------------------------------------------------------------------------- /Repositories/DepartmentRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using APIFuelStation.DbContexts; 5 | using APIFuelStation.IRepositories; 6 | using APIFuelStation.Models; 7 | 8 | namespace APIFuelStation.Repositories 9 | { 10 | public class DepartmentRepository : IDepartmentRepository 11 | { 12 | private readonly FuelDBContext _context; 13 | 14 | public DepartmentRepository(FuelDBContext context) 15 | { 16 | this._context = context; 17 | } 18 | 19 | public async Task CreateDepartment(Department department) 20 | { 21 | department.Code = "DEP" + department.Name; 22 | _context.Departments.Add(department); 23 | await _context.SaveChangesAsync(); 24 | return department; 25 | } 26 | 27 | public async Task DeleteDepartment(Department department) 28 | { 29 | _context.Departments.Remove(department); 30 | await _context.SaveChangesAsync(); 31 | return department; 32 | } 33 | 34 | public List GetAllDepartments() 35 | { 36 | return _context.Departments.ToList(); 37 | } 38 | 39 | public Department GetDepartmentById(int id) 40 | { 41 | return _context.Departments.FirstOrDefault(department => department.Id == id); 42 | } 43 | 44 | public Department GetDepartmentByCode(string code) 45 | { 46 | return _context.Departments.FirstOrDefault(department => department.Code == code); 47 | } 48 | 49 | public async Task UpdateDepartment(Department department) 50 | { 51 | _context.Departments.Update(department); 52 | await _context.SaveChangesAsync(); 53 | return department; 54 | } 55 | 56 | } 57 | } -------------------------------------------------------------------------------- /Repositories/DesignationRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using APIFuelStation.DbContexts; 5 | using APIFuelStation.IRepositories; 6 | using APIFuelStation.Models; 7 | 8 | namespace APIFuelStation.Repositories 9 | { 10 | public class DesignationRepository : IDesignationRepository 11 | { 12 | private readonly FuelDBContext _context; 13 | 14 | public DesignationRepository(FuelDBContext context) 15 | { 16 | this._context = context; 17 | } 18 | 19 | public async Task CreateDesignation(Designation designation) 20 | { 21 | designation.Code = "DES" + designation.Name; 22 | _context.Designations.Add(designation); 23 | await _context.SaveChangesAsync(); 24 | return designation; 25 | } 26 | 27 | public async Task DeleteDesignation(Designation designation) 28 | { 29 | _context.Designations.Remove(designation); 30 | await _context.SaveChangesAsync(); 31 | return designation; 32 | } 33 | 34 | public List GetAllDesignations() 35 | { 36 | return _context.Designations.ToList(); 37 | } 38 | 39 | public Designation GetDesignationById(int id) 40 | { 41 | return _context.Designations.FirstOrDefault(designation => designation.Id == id); 42 | } 43 | 44 | public Designation GetDesignationByCode(string code) 45 | { 46 | return _context.Designations.FirstOrDefault(designation => designation.Code == code); 47 | } 48 | 49 | public async Task UpdateDesignation(Designation designation) 50 | { 51 | _context.Designations.Update(designation); 52 | await _context.SaveChangesAsync(); 53 | return designation; 54 | } 55 | 56 | } 57 | } -------------------------------------------------------------------------------- /Repositories/EmployeeRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using APIFuelStation.DbContexts; 5 | using APIFuelStation.IRepositories; 6 | using APIFuelStation.Models; 7 | using BCrypt.Net; 8 | 9 | namespace APIFuelStation.Repositories { 10 | public class EmployeeRepository : IEmployeeRepository { 11 | private readonly FuelDBContext _context; 12 | 13 | public EmployeeRepository (FuelDBContext context) { 14 | this._context = context; 15 | } 16 | 17 | public async Task CreateEmployee (Employee user) { 18 | user.Password = BCrypt.Net.BCrypt.HashPassword (user.Password); 19 | _context.Employees.Add (user); 20 | await _context.SaveChangesAsync (); 21 | return user; 22 | } 23 | 24 | public async Task DeleteEmployee (Employee user) { 25 | _context.Employees.Remove (user); 26 | await _context.SaveChangesAsync (); 27 | return user; 28 | } 29 | 30 | public List GetAllEmployees () { 31 | return _context.Employees.ToList (); 32 | } 33 | 34 | public Employee GetEmployeeById (int id) { 35 | return _context.Employees.FirstOrDefault (x => x.Id == id); 36 | } 37 | 38 | public Employee GetEmployeeByEmail (string email) { 39 | return _context.Employees.FirstOrDefault (x => x.Email == email); 40 | } 41 | 42 | public Employee GetEmployeeByEmployeeName (string userName) { 43 | return _context.Employees.FirstOrDefault (x => x.UserName == userName); 44 | } 45 | 46 | public Employee GetEmployeeByPhoneNo (string phoneNo) { 47 | return _context.Employees.FirstOrDefault (x => x.PhoneNo == phoneNo); 48 | } 49 | 50 | public async Task UpdateEmployee (Employee user) { 51 | _context.Employees.Update (user); 52 | await _context.SaveChangesAsync (); 53 | return user; 54 | } 55 | 56 | } 57 | } -------------------------------------------------------------------------------- /Repositories/UserRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Threading.Tasks; 4 | using APIFuelStation.DbContexts; 5 | using APIFuelStation.IRepositories; 6 | using APIFuelStation.Models; 7 | using BCrypt.Net; 8 | 9 | namespace APIFuelStation.Repositories { 10 | public class UserRepository : IUserRepository { 11 | private readonly FuelDBContext _context; 12 | 13 | public UserRepository (FuelDBContext context) { 14 | this._context = context; 15 | } 16 | 17 | public async Task CreateUser (User user) { 18 | user.Password = BCrypt.Net.BCrypt.HashPassword (user.Password); 19 | _context.Users.Add (user); 20 | await _context.SaveChangesAsync (); 21 | return user; 22 | } 23 | 24 | public async Task DeleteUser (User user) { 25 | _context.Users.Remove (user); 26 | await _context.SaveChangesAsync (); 27 | return user; 28 | } 29 | 30 | public List GetAllUsers () { 31 | return _context.Users.ToList (); 32 | } 33 | 34 | public User GetUserById (int id) { 35 | return _context.Users.FirstOrDefault (x => x.Id == id); 36 | } 37 | 38 | public User GetUserByEmail (string email) { 39 | return _context.Users.FirstOrDefault (x => x.Email == email); 40 | } 41 | 42 | public User GetUserByUserName (string userName) { 43 | return _context.Users.FirstOrDefault (x => x.UserName == userName); 44 | } 45 | 46 | public User GetUserByPhoneNo (string phoneNo) { 47 | return _context.Users.FirstOrDefault (x => x.PhoneNo == phoneNo); 48 | } 49 | 50 | public async Task UpdateUser (User user) { 51 | _context.Users.Update (user); 52 | await _context.SaveChangesAsync (); 53 | return user; 54 | } 55 | 56 | } 57 | } -------------------------------------------------------------------------------- /Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Reflection; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using APIFuelStation.DbContexts; 9 | using APIFuelStation.IRepositories; 10 | using APIFuelStation.Models; 11 | using APIFuelStation.ModelsValidator; 12 | using APIFuelStation.Repositories; 13 | using FluentValidation; 14 | using FluentValidation.AspNetCore; 15 | using MediatR; 16 | using Microsoft.AspNetCore.Authentication.JwtBearer; 17 | using Microsoft.AspNetCore.Builder; 18 | using Microsoft.AspNetCore.Hosting; 19 | using Microsoft.AspNetCore.HttpsPolicy; 20 | using Microsoft.AspNetCore.Mvc; 21 | using Microsoft.EntityFrameworkCore; 22 | using Microsoft.Extensions.Configuration; 23 | using Microsoft.Extensions.DependencyInjection; 24 | using Microsoft.Extensions.Hosting; 25 | using Microsoft.Extensions.Logging; 26 | using Microsoft.IdentityModel.Tokens; 27 | using Microsoft.OpenApi.Models; 28 | using Newtonsoft.Json.Serialization; 29 | 30 | namespace APIFuelStation { 31 | public class Startup { 32 | public Startup (IConfiguration configuration) { 33 | Configuration = configuration; 34 | } 35 | 36 | public IConfiguration Configuration { get; } 37 | 38 | // This method gets called by the runtime. Use this method to add services to the container. 39 | public void ConfigureServices (IServiceCollection services) { 40 | 41 | // Add Database 42 | services.AddDbContext (opt => opt.UseSqlServer (Configuration.GetConnectionString ("FuelStationDBConnection"))); 43 | 44 | // Add Controller 45 | services.AddControllers ().AddNewtonsoftJson (s => { 46 | s.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver (); 47 | }); 48 | 49 | // Add Tables and Repositories 50 | services.AddScoped (); 51 | services.AddScoped (); 52 | services.AddScoped (); 53 | services.AddScoped (); 54 | 55 | // Add Validations Mapping 56 | services.AddTransient, UserValidator> (); 57 | services.AddTransient, DesignationValidator> (); 58 | services.AddTransient, DepartmentValidator> (); 59 | services.AddTransient, EmployeeValidator> (); 60 | 61 | // Add CORS Policy 62 | services.AddCors (options => { 63 | options.AddPolicy ("CorsPolicy", builder => builder.AllowAnyOrigin ().AllowAnyMethod ().AllowAnyHeader ().AllowCredentials ().Build ()); 64 | }); 65 | 66 | // Add Authentication 67 | services.AddAuthentication (JwtBearerDefaults.AuthenticationScheme) 68 | .AddJwtBearer (options => { 69 | options.TokenValidationParameters = new TokenValidationParameters { 70 | ValidateIssuer = true, 71 | ValidateAudience = true, 72 | ValidateLifetime = true, 73 | ClockSkew = TimeSpan.Zero, 74 | RequireExpirationTime = true, 75 | ValidateIssuerSigningKey = true, 76 | ValidIssuer = Configuration["Jwt:Issuer"], 77 | ValidAudience = Configuration["Jwt:Issuer"], 78 | IssuerSigningKey = new SymmetricSecurityKey (Encoding.UTF8.GetBytes (Configuration["Jwt:Key"])) 79 | }; 80 | }); 81 | 82 | // MVC and Fluent Validation 83 | services.AddMvc ().AddFluentValidation (); 84 | 85 | // Add Mediator 86 | services.AddMediatR (typeof (Startup)); 87 | 88 | // Add Swagger 89 | services.AddSwaggerGen (c => { 90 | c.SwaggerDoc ("v1", new OpenApiInfo { Title = "Fuel Station API", Description = "Fuel Station API Full using Dot Net Core 3.1", Version = "v1" }); 91 | c.AddSecurityDefinition ("Bearer", new OpenApiSecurityScheme { 92 | Description = @"JWT Authorization header using the Bearer scheme. \r\n\r\n 93 | Enter 'Bearer' [space] and then your token in the text input below. 94 | \r\n\r\nExample: 'Bearer 12345abcdef'", 95 | Name = "Authorization", 96 | In = ParameterLocation.Header, 97 | Type = SecuritySchemeType.ApiKey, 98 | Scheme = "Bearer" 99 | }); 100 | 101 | c.AddSecurityRequirement (new OpenApiSecurityRequirement () { 102 | { 103 | new OpenApiSecurityScheme { 104 | Reference = new OpenApiReference { 105 | Type = ReferenceType.SecurityScheme, 106 | Id = "Bearer" 107 | }, 108 | Scheme = "oauth2", 109 | Name = "Bearer", 110 | In = ParameterLocation.Header, 111 | 112 | }, 113 | new List () 114 | } 115 | }); 116 | 117 | var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml"; 118 | var xmlPath = Path.Combine (AppContext.BaseDirectory, xmlFile); 119 | c.IncludeXmlComments (xmlPath); 120 | }); 121 | 122 | } 123 | 124 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 125 | public void Configure (IApplicationBuilder app, IWebHostEnvironment env) { 126 | if (env.IsDevelopment ()) { 127 | app.UseDeveloperExceptionPage (); 128 | } 129 | 130 | app.UseHttpsRedirection (); 131 | 132 | app.UseRouting (); 133 | 134 | app.UseSwagger (); 135 | 136 | // Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.), 137 | // specifying the Swagger JSON endpoint. 138 | app.UseSwaggerUI (c => { 139 | c.SwaggerEndpoint ("/swagger/v1/swagger.json", "My API V1"); 140 | c.RoutePrefix = string.Empty; 141 | }); 142 | 143 | app.UseRouting (); 144 | 145 | app.UseAuthentication (); 146 | 147 | app.UseAuthorization (); 148 | 149 | app.UseEndpoints (endpoints => { 150 | endpoints.MapControllers (); 151 | }); 152 | } 153 | } 154 | } -------------------------------------------------------------------------------- /ViewModel/TokenViewModel.cs: -------------------------------------------------------------------------------- 1 | using APIFuelStation.Models; 2 | 3 | namespace APIFuelStation.ViewModel { 4 | public class TokenViewModel { 5 | public string? Token { get; set; } 6 | public string? RefreshToken { get; set; } 7 | public User? User { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace APIFuelStation 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 | -------------------------------------------------------------------------------- /appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*", 10 | "ConnectionStrings": { 11 | "FuelStationDBConnection": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=FuelStation;Integrated Security=False;Column Encryption Setting=enabled;MultipleActiveResultSets=True;" 12 | }, 13 | "Jwt": { 14 | "Key": "AshProgHelpSecretKey", 15 | "issuer": "ashproghelp.com" 16 | } 17 | } -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/APIFuelStation.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/APIFuelStation.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/APIFuelStation.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/APIFuelStation.exe -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/APIFuelStation.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/APIFuelStation.pdb -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/APIFuelStation.runtimeconfig.dev.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "additionalProbingPaths": [ 4 | "C:\\Users\\akash.corp\\.dotnet\\store\\|arch|\\|tfm|", 5 | "C:\\Users\\akash.corp\\.nuget\\packages" 6 | ] 7 | } 8 | } -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/APIFuelStation.runtimeconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeOptions": { 3 | "tfm": "netcoreapp3.1", 4 | "framework": { 5 | "name": "Microsoft.AspNetCore.App", 6 | "version": "3.1.0" 7 | }, 8 | "configProperties": { 9 | "System.GC.Server": true 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/APIFuelStation.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | APIFuelStation 5 | 6 | 7 | 8 | 9 | Get All of the Departments List 10 | 11 | A New Department 12 | 13 | 14 | 15 | Get Single Department By ID 16 | 17 | Get an Department 18 | If user id not found 19 | 20 | 21 | 22 | Creates a New Department 23 | 24 | 25 | Sample request: 26 | 27 | { 28 | "id": 0, 29 | "name": "Department 1", 30 | "code": "DEP12", 31 | } 32 | 33 | 34 | A newly created Department Item 35 | Returns the newly created item 36 | If any of the field is null 37 | 38 | 39 | 40 | Updates a user 41 | 42 | 43 | Sample request: 44 | 45 | { 46 | "id": 0, 47 | "firstName": "Maniruzzaman", 48 | "lastName": "Akash", 49 | "userName": "maniruzzaman", 50 | "email": "maniruzzamanAkash@gmail.com", 51 | "phoneNo": "01951233084", 52 | "password": "123456", 53 | "avatar": "string", 54 | "gender": true 55 | } 56 | 57 | 58 | A newly updated Department Item 59 | Returns the newly updated user 60 | If any of the field is null 61 | If user id not found 62 | 63 | 64 | 65 | Deletes a user 66 | 67 | Deleted Department Item 68 | Returns the newly deleted user 69 | If any of the field is null 70 | If user id not found 71 | 72 | 73 | 74 | Get All of the Designations List 75 | 76 | A New Designation 77 | 78 | 79 | 80 | Get Single Designation By ID 81 | 82 | Get an Designation 83 | If user id not found 84 | 85 | 86 | 87 | Creates a New Designation 88 | 89 | 90 | Sample request: 91 | 92 | { 93 | "id": 0, 94 | "name": "Designation 1", 95 | "code": "DEP12", 96 | } 97 | 98 | 99 | A newly created Designation Item 100 | Returns the newly created item 101 | If any of the field is null 102 | 103 | 104 | 105 | Updates a user 106 | 107 | 108 | Sample request: 109 | 110 | { 111 | "id": 0, 112 | "firstName": "Maniruzzaman", 113 | "lastName": "Akash", 114 | "userName": "maniruzzaman", 115 | "email": "maniruzzamanAkash@gmail.com", 116 | "phoneNo": "01951233084", 117 | "password": "123456", 118 | "avatar": "string", 119 | "gender": true 120 | } 121 | 122 | 123 | A newly updated Designation Item 124 | Returns the newly updated user 125 | If any of the field is null 126 | If user id not found 127 | 128 | 129 | 130 | Deletes a user 131 | 132 | Deleted Designation Item 133 | Returns the newly deleted user 134 | If any of the field is null 135 | If user id not found 136 | 137 | 138 | 139 | Get All of the Employees List 140 | 141 | A New Employee 142 | 143 | 144 | 145 | Get Single Employee By ID 146 | 147 | Get an Employee 148 | If user id not found 149 | 150 | 151 | 152 | Creates a New Employee 153 | 154 | 155 | Sample request: 156 | 157 | { 158 | "id": 0, 159 | "firstName": "string", 160 | "userName": "string", 161 | "email": "string", 162 | "phoneNo": "string", 163 | "gender": true, 164 | "lastName": "string", 165 | "password": "string", 166 | "avatar": "string", 167 | "joiningDate": "2020-06-23", 168 | "designationId": 0, 169 | "departmentId": 0 170 | } 171 | 172 | 173 | A newly created Employee Item 174 | Returns the newly created item 175 | If any of the field is null 176 | 177 | 178 | 179 | Updates an employee 180 | 181 | 182 | Sample request: 183 | 184 | { 185 | "id": 1, 186 | "firstName": "string", 187 | "userName": "string", 188 | "email": "string", 189 | "phoneNo": "string", 190 | "gender": true, 191 | "lastName": "string", 192 | "password": "string", 193 | "avatar": "string", 194 | "joiningDate": "2020-06-23", 195 | "designationId": 0, 196 | "departmentId": 0 197 | } 198 | 199 | 200 | A newly updated Employee Item 201 | Returns the newly updated user 202 | If any of the field is null 203 | If user id not found 204 | 205 | 206 | 207 | Deletes a user 208 | 209 | Deleted Employee Item 210 | Returns the newly deleted user 211 | If any of the field is null 212 | If user id not found 213 | 214 | 215 | 216 | Get All of the Users List 217 | 218 | A New User 219 | 220 | 221 | 222 | Get Single User By ID 223 | 224 | Get an User 225 | If user id not found 226 | 227 | 228 | 229 | Creates a New User 230 | 231 | 232 | Sample request: 233 | 234 | { 235 | "id": 0, 236 | "firstName": "Maniruzzaman", 237 | "lastName": "Akash", 238 | "userName": "maniruzzaman", 239 | "email": "maniruzzamanAkash@gmail.com", 240 | "phoneNo": "01951233084", 241 | "password": "123456", 242 | "avatar": "string", 243 | "gender": true 244 | } 245 | 246 | 247 | A newly created User Item 248 | Returns the newly created item 249 | If any of the field is null 250 | 251 | 252 | 253 | Updates a user 254 | 255 | 256 | Sample request: 257 | 258 | { 259 | "id": 0, 260 | "firstName": "Maniruzzaman", 261 | "lastName": "Akash", 262 | "userName": "maniruzzaman", 263 | "email": "maniruzzamanAkash@gmail.com", 264 | "phoneNo": "01951233084", 265 | "password": "123456", 266 | "avatar": "string", 267 | "gender": true 268 | } 269 | 270 | 271 | A newly updated User Item 272 | Returns the newly updated user 273 | If any of the field is null 274 | If user id not found 275 | 276 | 277 | 278 | Deletes a user 279 | 280 | Deleted User Item 281 | Returns the newly deleted user 282 | If any of the field is null 283 | If user id not found 284 | 285 | 286 | 287 | -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/AutoMapper.Extensions.Microsoft.DependencyInjection.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/AutoMapper.Extensions.Microsoft.DependencyInjection.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/AutoMapper.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/AutoMapper.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/BCrypt.Net-Next.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/BCrypt.Net-Next.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/FluentValidation.AspNetCore.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/FluentValidation.AspNetCore.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/FluentValidation.DependencyInjectionExtensions.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/FluentValidation.DependencyInjectionExtensions.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/FluentValidation.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/FluentValidation.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/MediatR.Extensions.Microsoft.DependencyInjection.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/MediatR.Extensions.Microsoft.DependencyInjection.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/MediatR.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/MediatR.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Microsoft.AspNetCore.Authentication.JwtBearer.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Microsoft.AspNetCore.Authentication.JwtBearer.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Microsoft.AspNetCore.JsonPatch.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Microsoft.AspNetCore.JsonPatch.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Microsoft.Bcl.AsyncInterfaces.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Microsoft.Bcl.AsyncInterfaces.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Microsoft.Bcl.HashCode.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Microsoft.Bcl.HashCode.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Microsoft.Data.SqlClient.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Microsoft.Data.SqlClient.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Microsoft.EntityFrameworkCore.Abstractions.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Microsoft.EntityFrameworkCore.Abstractions.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Microsoft.EntityFrameworkCore.Design.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Microsoft.EntityFrameworkCore.Design.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Microsoft.EntityFrameworkCore.Relational.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Microsoft.EntityFrameworkCore.Relational.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Microsoft.EntityFrameworkCore.SqlServer.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Microsoft.EntityFrameworkCore.SqlServer.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Microsoft.EntityFrameworkCore.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Microsoft.EntityFrameworkCore.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Microsoft.Extensions.Caching.Abstractions.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Caching.Abstractions.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Microsoft.Extensions.Caching.Memory.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Caching.Memory.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Microsoft.Extensions.Configuration.Abstractions.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Configuration.Abstractions.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Microsoft.Extensions.Configuration.Binder.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Configuration.Binder.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Microsoft.Extensions.Configuration.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Configuration.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Microsoft.Extensions.DependencyInjection.Abstractions.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Microsoft.Extensions.DependencyInjection.Abstractions.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Microsoft.Extensions.DependencyInjection.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Microsoft.Extensions.DependencyInjection.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Microsoft.Extensions.Logging.Abstractions.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Logging.Abstractions.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Microsoft.Extensions.Logging.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Logging.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Microsoft.Extensions.Options.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Options.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Microsoft.Extensions.Primitives.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Microsoft.Extensions.Primitives.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Microsoft.Identity.Client.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Microsoft.Identity.Client.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Microsoft.IdentityModel.JsonWebTokens.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Microsoft.IdentityModel.JsonWebTokens.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Microsoft.IdentityModel.Logging.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Microsoft.IdentityModel.Logging.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Microsoft.IdentityModel.Protocols.OpenIdConnect.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Microsoft.IdentityModel.Protocols.OpenIdConnect.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Microsoft.IdentityModel.Protocols.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Microsoft.IdentityModel.Protocols.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Microsoft.IdentityModel.Tokens.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Microsoft.IdentityModel.Tokens.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Microsoft.OpenApi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Microsoft.OpenApi.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Newtonsoft.Json.Bson.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Newtonsoft.Json.Bson.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/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:34044", 8 | "sslPort": 44355 9 | } 10 | }, 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": true, 15 | "launchUrl": "weatherforecast", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "APIFuelStation": { 21 | "commandName": "Project", 22 | "launchBrowser": true, 23 | "launchUrl": "weatherforecast", 24 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 25 | "environmentVariables": { 26 | "ASPNETCORE_ENVIRONMENT": "Development" 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Swashbuckle.AspNetCore.Swagger.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Swashbuckle.AspNetCore.Swagger.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Swashbuckle.AspNetCore.SwaggerGen.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Swashbuckle.AspNetCore.SwaggerGen.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/Swashbuckle.AspNetCore.SwaggerUI.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/Swashbuckle.AspNetCore.SwaggerUI.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/System.Collections.Immutable.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/System.Collections.Immutable.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/System.Configuration.ConfigurationManager.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/System.Configuration.ConfigurationManager.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/System.Diagnostics.DiagnosticSource.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/System.Diagnostics.DiagnosticSource.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/System.IdentityModel.Tokens.Jwt.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/System.IdentityModel.Tokens.Jwt.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/System.Runtime.Caching.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/System.Runtime.Caching.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/System.Security.Cryptography.ProtectedData.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/System.Security.Cryptography.ProtectedData.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*", 10 | "ConnectionStrings": { 11 | "FuelStationDBConnection": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=FuelStation;Integrated Security=False;Column Encryption Setting=enabled;MultipleActiveResultSets=True;" 12 | }, 13 | "Jwt": { 14 | "Key": "AshProgHelpSecretKey", 15 | "issuer": "ashproghelp.com" 16 | } 17 | } -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/runtimes/unix/lib/netcoreapp2.0/System.Runtime.Caching.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/runtimes/unix/lib/netcoreapp2.0/System.Runtime.Caching.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/runtimes/unix/lib/netcoreapp2.1/Microsoft.Data.SqlClient.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/runtimes/unix/lib/netcoreapp2.1/Microsoft.Data.SqlClient.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/runtimes/win-arm64/native/sni.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/runtimes/win-arm64/native/sni.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/runtimes/win-x64/native/sni.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/runtimes/win-x64/native/sni.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/runtimes/win-x86/native/sni.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/runtimes/win-x86/native/sni.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/runtimes/win/lib/netcoreapp2.0/System.Runtime.Caching.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/runtimes/win/lib/netcoreapp2.0/System.Runtime.Caching.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/runtimes/win/lib/netcoreapp2.1/Microsoft.Data.SqlClient.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/runtimes/win/lib/netcoreapp2.1/Microsoft.Data.SqlClient.dll -------------------------------------------------------------------------------- /bin/Debug/netcoreapp3.1/runtimes/win/lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/bin/Debug/netcoreapp3.1/runtimes/win/lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll -------------------------------------------------------------------------------- /obj/APIFuelStation.csproj.EntityFrameworkCore.targets: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /obj/APIFuelStation.csproj.nuget.dgspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "format": 1, 3 | "restore": { 4 | "C:\\Users\\akash.corp\\projs\\APIFuelStation\\APIFuelStation.csproj": {} 5 | }, 6 | "projects": { 7 | "C:\\Users\\akash.corp\\projs\\APIFuelStation\\APIFuelStation.csproj": { 8 | "version": "1.0.0", 9 | "restore": { 10 | "projectUniqueName": "C:\\Users\\akash.corp\\projs\\APIFuelStation\\APIFuelStation.csproj", 11 | "projectName": "APIFuelStation", 12 | "projectPath": "C:\\Users\\akash.corp\\projs\\APIFuelStation\\APIFuelStation.csproj", 13 | "packagesPath": "C:\\Users\\akash.corp\\.nuget\\packages\\", 14 | "outputPath": "C:\\Users\\akash.corp\\projs\\APIFuelStation\\obj\\", 15 | "projectStyle": "PackageReference", 16 | "configFilePaths": [ 17 | "C:\\Users\\akash.corp\\AppData\\Roaming\\NuGet\\NuGet.Config", 18 | "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" 19 | ], 20 | "originalTargetFrameworks": [ 21 | "netcoreapp3.1" 22 | ], 23 | "sources": { 24 | "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, 25 | "https://api.nuget.org/v3/index.json": {} 26 | }, 27 | "frameworks": { 28 | "netcoreapp3.1": { 29 | "projectReferences": {} 30 | } 31 | }, 32 | "warningProperties": { 33 | "warnAsError": [ 34 | "NU1605" 35 | ] 36 | } 37 | }, 38 | "frameworks": { 39 | "netcoreapp3.1": { 40 | "dependencies": { 41 | "AutoMapper.Extensions.Microsoft.DependencyInjection": { 42 | "target": "Package", 43 | "version": "[7.0.0, )" 44 | }, 45 | "BCrypt.Net-Next": { 46 | "target": "Package", 47 | "version": "[4.0.0, )" 48 | }, 49 | "FluentValidation.AspNetCore": { 50 | "target": "Package", 51 | "version": "[8.6.2, )" 52 | }, 53 | "MediatR": { 54 | "target": "Package", 55 | "version": "[8.0.1, )" 56 | }, 57 | "MediatR.Extensions.Microsoft.DependencyInjection": { 58 | "target": "Package", 59 | "version": "[8.0.0, )" 60 | }, 61 | "Microsoft.AspNetCore.Authentication.JwtBearer": { 62 | "target": "Package", 63 | "version": "[3.1.5, )" 64 | }, 65 | "Microsoft.AspNetCore.JsonPatch": { 66 | "target": "Package", 67 | "version": "[3.1.5, )" 68 | }, 69 | "Microsoft.AspNetCore.Mvc.NewtonsoftJson": { 70 | "target": "Package", 71 | "version": "[3.1.5, )" 72 | }, 73 | "Microsoft.EntityFrameworkCore": { 74 | "target": "Package", 75 | "version": "[3.1.5, )" 76 | }, 77 | "Microsoft.EntityFrameworkCore.Design": { 78 | "include": "Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive", 79 | "suppressParent": "All", 80 | "target": "Package", 81 | "version": "[3.1.5, )" 82 | }, 83 | "Microsoft.EntityFrameworkCore.SqlServer": { 84 | "target": "Package", 85 | "version": "[3.1.5, )" 86 | }, 87 | "Microsoft.IdentityModel.Tokens": { 88 | "target": "Package", 89 | "version": "[6.6.0, )" 90 | }, 91 | "Swashbuckle.AspNetCore": { 92 | "target": "Package", 93 | "version": "[5.5.0, )" 94 | }, 95 | "System.IdentityModel.Tokens.Jwt": { 96 | "target": "Package", 97 | "version": "[6.6.0, )" 98 | } 99 | }, 100 | "imports": [ 101 | "net461", 102 | "net462", 103 | "net47", 104 | "net471", 105 | "net472", 106 | "net48" 107 | ], 108 | "assetTargetFallback": true, 109 | "warn": true, 110 | "frameworkReferences": { 111 | "Microsoft.AspNetCore.App": { 112 | "privateAssets": "none" 113 | }, 114 | "Microsoft.NETCore.App": { 115 | "privateAssets": "all" 116 | } 117 | }, 118 | "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\3.1.301\\RuntimeIdentifierGraph.json" 119 | } 120 | } 121 | } 122 | } 123 | } -------------------------------------------------------------------------------- /obj/APIFuelStation.csproj.nuget.g.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | True 5 | NuGet 6 | $(MSBuildThisFileDirectory)project.assets.json 7 | $(UserProfile)\.nuget\packages\ 8 | C:\Users\akash.corp\.nuget\packages\ 9 | PackageReference 10 | 5.6.0 11 | 12 | 13 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | C:\Users\akash.corp\.nuget\packages\microsoft.extensions.apidescription.server\3.0.0 22 | 23 | -------------------------------------------------------------------------------- /obj/APIFuelStation.csproj.nuget.g.targets: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | // 2 | using System; 3 | using System.Reflection; 4 | [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v3.1", FrameworkDisplayName = "")] 5 | -------------------------------------------------------------------------------- /obj/Debug/netcoreapp3.1/APIFuelStation.AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | 10 | using System; 11 | using System.Reflection; 12 | 13 | [assembly: System.Reflection.AssemblyCompanyAttribute("APIFuelStation")] 14 | [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] 15 | [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] 16 | [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] 17 | [assembly: System.Reflection.AssemblyProductAttribute("APIFuelStation")] 18 | [assembly: System.Reflection.AssemblyTitleAttribute("APIFuelStation")] 19 | [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] 20 | 21 | // Generated by the MSBuild WriteCodeFragment class. 22 | 23 | -------------------------------------------------------------------------------- /obj/Debug/netcoreapp3.1/APIFuelStation.AssemblyInfoInputs.cache: -------------------------------------------------------------------------------- 1 | 8bbfaa1583f2bae19035d6dc00563d6d4ffea3ba 2 | -------------------------------------------------------------------------------- /obj/Debug/netcoreapp3.1/APIFuelStation.MvcApplicationPartsAssemblyInfo.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/obj/Debug/netcoreapp3.1/APIFuelStation.MvcApplicationPartsAssemblyInfo.cache -------------------------------------------------------------------------------- /obj/Debug/netcoreapp3.1/APIFuelStation.MvcApplicationPartsAssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | 10 | using System; 11 | using System.Reflection; 12 | 13 | [assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("FluentValidation.AspNetCore")] 14 | [assembly: Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartAttribute("Swashbuckle.AspNetCore.SwaggerGen")] 15 | 16 | // Generated by the MSBuild WriteCodeFragment class. 17 | 18 | -------------------------------------------------------------------------------- /obj/Debug/netcoreapp3.1/APIFuelStation.RazorTargetAssemblyInfo.cache: -------------------------------------------------------------------------------- 1 | 692f087003c79bfe36abf2c3cd9cc330ec2980c8 2 | -------------------------------------------------------------------------------- /obj/Debug/netcoreapp3.1/APIFuelStation.assets.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/obj/Debug/netcoreapp3.1/APIFuelStation.assets.cache -------------------------------------------------------------------------------- /obj/Debug/netcoreapp3.1/APIFuelStation.csproj.CopyComplete: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/obj/Debug/netcoreapp3.1/APIFuelStation.csproj.CopyComplete -------------------------------------------------------------------------------- /obj/Debug/netcoreapp3.1/APIFuelStation.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | a2748ae18b58af2d96f4656b7157ab1d6dc9c794 2 | -------------------------------------------------------------------------------- /obj/Debug/netcoreapp3.1/APIFuelStation.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\appsettings.Development.json 2 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\appsettings.json 3 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Properties\launchSettings.json 4 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\APIFuelStation.exe 5 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\AutoMapper.dll 6 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\AutoMapper.Extensions.Microsoft.DependencyInjection.dll 7 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\MediatR.dll 8 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\MediatR.Extensions.Microsoft.DependencyInjection.dll 9 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Microsoft.AspNetCore.Authentication.JwtBearer.dll 10 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Microsoft.AspNetCore.JsonPatch.dll 11 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Microsoft.AspNetCore.Mvc.NewtonsoftJson.dll 12 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Microsoft.Bcl.AsyncInterfaces.dll 13 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Microsoft.Bcl.HashCode.dll 14 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Microsoft.Data.SqlClient.dll 15 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Microsoft.EntityFrameworkCore.dll 16 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Microsoft.EntityFrameworkCore.Abstractions.dll 17 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Microsoft.EntityFrameworkCore.Design.dll 18 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Microsoft.EntityFrameworkCore.Relational.dll 19 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Microsoft.EntityFrameworkCore.SqlServer.dll 20 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Microsoft.Extensions.Caching.Abstractions.dll 21 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Microsoft.Extensions.Caching.Memory.dll 22 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Microsoft.Extensions.Configuration.dll 23 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Microsoft.Extensions.Configuration.Abstractions.dll 24 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Microsoft.Extensions.Configuration.Binder.dll 25 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Microsoft.Extensions.DependencyInjection.dll 26 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Microsoft.Extensions.DependencyInjection.Abstractions.dll 27 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Microsoft.Extensions.Logging.dll 28 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Microsoft.Extensions.Logging.Abstractions.dll 29 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Microsoft.Extensions.Options.dll 30 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Microsoft.Extensions.Primitives.dll 31 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Microsoft.Identity.Client.dll 32 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Microsoft.IdentityModel.JsonWebTokens.dll 33 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Microsoft.IdentityModel.Logging.dll 34 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Microsoft.IdentityModel.Protocols.dll 35 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Microsoft.IdentityModel.Protocols.OpenIdConnect.dll 36 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Microsoft.IdentityModel.Tokens.dll 37 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Microsoft.OpenApi.dll 38 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Newtonsoft.Json.dll 39 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Newtonsoft.Json.Bson.dll 40 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Swashbuckle.AspNetCore.Swagger.dll 41 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Swashbuckle.AspNetCore.SwaggerGen.dll 42 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\Swashbuckle.AspNetCore.SwaggerUI.dll 43 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\System.Collections.Immutable.dll 44 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\System.Configuration.ConfigurationManager.dll 45 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\System.Diagnostics.DiagnosticSource.dll 46 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\System.IdentityModel.Tokens.Jwt.dll 47 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\System.Runtime.Caching.dll 48 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\System.Security.Cryptography.ProtectedData.dll 49 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\runtimes\unix\lib\netcoreapp2.1\Microsoft.Data.SqlClient.dll 50 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\runtimes\win\lib\netcoreapp2.1\Microsoft.Data.SqlClient.dll 51 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\runtimes\win-arm64\native\sni.dll 52 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\runtimes\win-x64\native\sni.dll 53 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\runtimes\win-x86\native\sni.dll 54 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\runtimes\unix\lib\netcoreapp2.0\System.Runtime.Caching.dll 55 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\runtimes\win\lib\netcoreapp2.0\System.Runtime.Caching.dll 56 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\runtimes\win\lib\netstandard2.0\System.Security.Cryptography.ProtectedData.dll 57 | C:\Users\akash.corp\projs\APIFuelStation\obj\Debug\netcoreapp3.1\APIFuelStation.csprojAssemblyReference.cache 58 | C:\Users\akash.corp\projs\APIFuelStation\obj\Debug\netcoreapp3.1\APIFuelStation.AssemblyInfoInputs.cache 59 | C:\Users\akash.corp\projs\APIFuelStation\obj\Debug\netcoreapp3.1\APIFuelStation.AssemblyInfo.cs 60 | C:\Users\akash.corp\projs\APIFuelStation\obj\Debug\netcoreapp3.1\APIFuelStation.csproj.CoreCompileInputs.cache 61 | C:\Users\akash.corp\projs\APIFuelStation\obj\Debug\netcoreapp3.1\APIFuelStation.MvcApplicationPartsAssemblyInfo.cs 62 | C:\Users\akash.corp\projs\APIFuelStation\obj\Debug\netcoreapp3.1\APIFuelStation.MvcApplicationPartsAssemblyInfo.cache 63 | C:\Users\akash.corp\projs\APIFuelStation\obj\Debug\netcoreapp3.1\APIFuelStation.RazorTargetAssemblyInfo.cache 64 | C:\Users\akash.corp\projs\APIFuelStation\obj\Debug\netcoreapp3.1\APIFuelStation.csproj.CopyComplete 65 | C:\Users\akash.corp\projs\APIFuelStation\obj\Debug\netcoreapp3.1\staticwebassets\APIFuelStation.StaticWebAssets.Manifest.cache 66 | C:\Users\akash.corp\projs\APIFuelStation\obj\Debug\netcoreapp3.1\staticwebassets\APIFuelStation.StaticWebAssets.xml 67 | C:\Users\akash.corp\projs\APIFuelStation\obj\Debug\netcoreapp3.1\APIFuelStation.dll 68 | C:\Users\akash.corp\projs\APIFuelStation\obj\Debug\netcoreapp3.1\APIFuelStation.pdb 69 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\APIFuelStation.deps.json 70 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\APIFuelStation.runtimeconfig.json 71 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\APIFuelStation.runtimeconfig.dev.json 72 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\APIFuelStation.dll 73 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\APIFuelStation.pdb 74 | C:\Users\akash.corp\projs\APIFuelStation\obj\Debug\netcoreapp3.1\APIFuelStation.genruntimeconfig.cache 75 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\APIFuelStation.xml 76 | C:\Users\akash.corp\projs\APIFuelStation\obj\Debug\netcoreapp3.1\APIFuelStation.xml 77 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\BCrypt.Net-Next.dll 78 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\FluentValidation.dll 79 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\FluentValidation.AspNetCore.dll 80 | C:\Users\akash.corp\projs\APIFuelStation\bin\Debug\netcoreapp3.1\FluentValidation.DependencyInjectionExtensions.dll 81 | -------------------------------------------------------------------------------- /obj/Debug/netcoreapp3.1/APIFuelStation.csprojAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/obj/Debug/netcoreapp3.1/APIFuelStation.csprojAssemblyReference.cache -------------------------------------------------------------------------------- /obj/Debug/netcoreapp3.1/APIFuelStation.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/obj/Debug/netcoreapp3.1/APIFuelStation.dll -------------------------------------------------------------------------------- /obj/Debug/netcoreapp3.1/APIFuelStation.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/obj/Debug/netcoreapp3.1/APIFuelStation.exe -------------------------------------------------------------------------------- /obj/Debug/netcoreapp3.1/APIFuelStation.genruntimeconfig.cache: -------------------------------------------------------------------------------- 1 | 86c8e15dd33445635927cfaf398408205fd11473 2 | -------------------------------------------------------------------------------- /obj/Debug/netcoreapp3.1/APIFuelStation.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/obj/Debug/netcoreapp3.1/APIFuelStation.pdb -------------------------------------------------------------------------------- /obj/Debug/netcoreapp3.1/APIFuelStation.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | APIFuelStation 5 | 6 | 7 | 8 | 9 | Get All of the Departments List 10 | 11 | A New Department 12 | 13 | 14 | 15 | Get Single Department By ID 16 | 17 | Get an Department 18 | If user id not found 19 | 20 | 21 | 22 | Creates a New Department 23 | 24 | 25 | Sample request: 26 | 27 | { 28 | "id": 0, 29 | "name": "Department 1", 30 | "code": "DEP12", 31 | } 32 | 33 | 34 | A newly created Department Item 35 | Returns the newly created item 36 | If any of the field is null 37 | 38 | 39 | 40 | Updates a user 41 | 42 | 43 | Sample request: 44 | 45 | { 46 | "id": 0, 47 | "firstName": "Maniruzzaman", 48 | "lastName": "Akash", 49 | "userName": "maniruzzaman", 50 | "email": "maniruzzamanAkash@gmail.com", 51 | "phoneNo": "01951233084", 52 | "password": "123456", 53 | "avatar": "string", 54 | "gender": true 55 | } 56 | 57 | 58 | A newly updated Department Item 59 | Returns the newly updated user 60 | If any of the field is null 61 | If user id not found 62 | 63 | 64 | 65 | Deletes a user 66 | 67 | Deleted Department Item 68 | Returns the newly deleted user 69 | If any of the field is null 70 | If user id not found 71 | 72 | 73 | 74 | Get All of the Designations List 75 | 76 | A New Designation 77 | 78 | 79 | 80 | Get Single Designation By ID 81 | 82 | Get an Designation 83 | If user id not found 84 | 85 | 86 | 87 | Creates a New Designation 88 | 89 | 90 | Sample request: 91 | 92 | { 93 | "id": 0, 94 | "name": "Designation 1", 95 | "code": "DEP12", 96 | } 97 | 98 | 99 | A newly created Designation Item 100 | Returns the newly created item 101 | If any of the field is null 102 | 103 | 104 | 105 | Updates a user 106 | 107 | 108 | Sample request: 109 | 110 | { 111 | "id": 0, 112 | "firstName": "Maniruzzaman", 113 | "lastName": "Akash", 114 | "userName": "maniruzzaman", 115 | "email": "maniruzzamanAkash@gmail.com", 116 | "phoneNo": "01951233084", 117 | "password": "123456", 118 | "avatar": "string", 119 | "gender": true 120 | } 121 | 122 | 123 | A newly updated Designation Item 124 | Returns the newly updated user 125 | If any of the field is null 126 | If user id not found 127 | 128 | 129 | 130 | Deletes a user 131 | 132 | Deleted Designation Item 133 | Returns the newly deleted user 134 | If any of the field is null 135 | If user id not found 136 | 137 | 138 | 139 | Get All of the Employees List 140 | 141 | A New Employee 142 | 143 | 144 | 145 | Get Single Employee By ID 146 | 147 | Get an Employee 148 | If user id not found 149 | 150 | 151 | 152 | Creates a New Employee 153 | 154 | 155 | Sample request: 156 | 157 | { 158 | "id": 0, 159 | "firstName": "string", 160 | "userName": "string", 161 | "email": "string", 162 | "phoneNo": "string", 163 | "gender": true, 164 | "lastName": "string", 165 | "password": "string", 166 | "avatar": "string", 167 | "joiningDate": "2020-06-23", 168 | "designationId": 0, 169 | "departmentId": 0 170 | } 171 | 172 | 173 | A newly created Employee Item 174 | Returns the newly created item 175 | If any of the field is null 176 | 177 | 178 | 179 | Updates an employee 180 | 181 | 182 | Sample request: 183 | 184 | { 185 | "id": 1, 186 | "firstName": "string", 187 | "userName": "string", 188 | "email": "string", 189 | "phoneNo": "string", 190 | "gender": true, 191 | "lastName": "string", 192 | "password": "string", 193 | "avatar": "string", 194 | "joiningDate": "2020-06-23", 195 | "designationId": 0, 196 | "departmentId": 0 197 | } 198 | 199 | 200 | A newly updated Employee Item 201 | Returns the newly updated user 202 | If any of the field is null 203 | If user id not found 204 | 205 | 206 | 207 | Deletes a user 208 | 209 | Deleted Employee Item 210 | Returns the newly deleted user 211 | If any of the field is null 212 | If user id not found 213 | 214 | 215 | 216 | Get All of the Users List 217 | 218 | A New User 219 | 220 | 221 | 222 | Get Single User By ID 223 | 224 | Get an User 225 | If user id not found 226 | 227 | 228 | 229 | Creates a New User 230 | 231 | 232 | Sample request: 233 | 234 | { 235 | "id": 0, 236 | "firstName": "Maniruzzaman", 237 | "lastName": "Akash", 238 | "userName": "maniruzzaman", 239 | "email": "maniruzzamanAkash@gmail.com", 240 | "phoneNo": "01951233084", 241 | "password": "123456", 242 | "avatar": "string", 243 | "gender": true 244 | } 245 | 246 | 247 | A newly created User Item 248 | Returns the newly created item 249 | If any of the field is null 250 | 251 | 252 | 253 | Updates a user 254 | 255 | 256 | Sample request: 257 | 258 | { 259 | "id": 0, 260 | "firstName": "Maniruzzaman", 261 | "lastName": "Akash", 262 | "userName": "maniruzzaman", 263 | "email": "maniruzzamanAkash@gmail.com", 264 | "phoneNo": "01951233084", 265 | "password": "123456", 266 | "avatar": "string", 267 | "gender": true 268 | } 269 | 270 | 271 | A newly updated User Item 272 | Returns the newly updated user 273 | If any of the field is null 274 | If user id not found 275 | 276 | 277 | 278 | Deletes a user 279 | 280 | Deleted User Item 281 | Returns the newly deleted user 282 | If any of the field is null 283 | If user id not found 284 | 285 | 286 | 287 | -------------------------------------------------------------------------------- /obj/Debug/netcoreapp3.1/staticwebassets/APIFuelStation.StaticWebAssets.Manifest.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManiruzzamanAkash/ERPAPI/f5db98e901d14e8c1691a5be5d32732680ad2518/obj/Debug/netcoreapp3.1/staticwebassets/APIFuelStation.StaticWebAssets.Manifest.cache -------------------------------------------------------------------------------- /obj/Debug/netcoreapp3.1/staticwebassets/APIFuelStation.StaticWebAssets.xml: -------------------------------------------------------------------------------- 1 |  --------------------------------------------------------------------------------