| # Visual Studio Version 16 | # Visual Studio Version 16 | ||||
| VisualStudioVersion = 16.0.30002.166 | VisualStudioVersion = 16.0.30002.166 | ||||
| MinimumVisualStudioVersion = 10.0.40219.1 | MinimumVisualStudioVersion = 10.0.40219.1 | ||||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Diligent.API", "src\Diligent.API\Diligent.API.csproj", "{865F036B-DA1A-499C-AFDB-9418F3634FEF}" | |||||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Diligent.WebApi", "src\Diligent.WebApi\Diligent.WebApi.csproj", "{865F036B-DA1A-499C-AFDB-9418F3634FEF}" | |||||
| ProjectSection(ProjectDependencies) = postProject | ProjectSection(ProjectDependencies) = postProject | ||||
| {EB880A2A-D054-4225-8F4D-3B1F91B75CB8} = {EB880A2A-D054-4225-8F4D-3B1F91B75CB8} | {EB880A2A-D054-4225-8F4D-3B1F91B75CB8} = {EB880A2A-D054-4225-8F4D-3B1F91B75CB8} | ||||
| {199A8692-04A6-4DE6-980D-7DD14DDF59BB} = {199A8692-04A6-4DE6-980D-7DD14DDF59BB} | {199A8692-04A6-4DE6-980D-7DD14DDF59BB} = {199A8692-04A6-4DE6-980D-7DD14DDF59BB} |
| using Microsoft.AspNetCore.Http; | using Microsoft.AspNetCore.Http; | ||||
| using Microsoft.AspNetCore.Mvc; | using Microsoft.AspNetCore.Mvc; | ||||
| namespace Diligent.API.Controllers | |||||
| namespace Diligent.WebApi.Controllers | |||||
| { | { | ||||
| [Route("api/[controller]")] | [Route("api/[controller]")] | ||||
| [ApiController] | [ApiController] |
| using Microsoft.AspNetCore.Mvc; | using Microsoft.AspNetCore.Mvc; | ||||
| using System.Collections.Generic; | using System.Collections.Generic; | ||||
| namespace Diligent.API.Controllers | |||||
| namespace Diligent.WebApi.Controllers | |||||
| { | { | ||||
| [Route("api/[controller]")] | [Route("api/[controller]")] | ||||
| [ApiController] | [ApiController] |
| using System.Linq; | using System.Linq; | ||||
| using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
| using AutoMapper; | using AutoMapper; | ||||
| using Diligent.API.Models; | |||||
| using Diligent.API.Models.Users; | |||||
| using Diligent.WebApi.Models; | |||||
| using Diligent.WebApi.Models.Users; | |||||
| using MediatR; | using MediatR; | ||||
| using Microsoft.AspNetCore.Authorization; | using Microsoft.AspNetCore.Authorization; | ||||
| using Microsoft.AspNetCore.Http; | using Microsoft.AspNetCore.Http; | ||||
| using Microsoft.AspNetCore.Mvc; | using Microsoft.AspNetCore.Mvc; | ||||
| namespace Diligent.API.Controllers | |||||
| namespace Diligent.WebApi.Controllers | |||||
| { | { | ||||
| //[ApiVersion("1.0.0")] // MAJOR.MINOR.PATCH | //[ApiVersion("1.0.0")] // MAJOR.MINOR.PATCH | ||||
| //[Route("api/{v:apiVersion}/users")] | //[Route("api/{v:apiVersion}/users")] |
| using MediatR; | using MediatR; | ||||
| using Diligent.API.Models.Users; | |||||
| using Diligent.WebApi.Models.Users; | |||||
| using System; | using System; | ||||
| using System.Collections.Generic; | using System.Collections.Generic; | ||||
| using System.Linq; | using System.Linq; | ||||
| using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
| using Diligent.API.Models; | |||||
| using Diligent.WebApi.Models; | |||||
| using System.Threading; | using System.Threading; | ||||
| using Diligent.Services.Interface; | using Diligent.Services.Interface; | ||||
| using AutoMapper; | using AutoMapper; | ||||
| using FluentValidation; | using FluentValidation; | ||||
| using Diligent.API.Infrastructure.Results; | |||||
| using Diligent.WebApi.Infrastructure.Results; | |||||
| namespace Diligent.API.Handlers | |||||
| namespace Diligent.WebApi.Handlers | |||||
| { | { | ||||
| public class UsersHandlers : IRequestHandler<GetQuery, Result<UserDto>>, | public class UsersHandlers : IRequestHandler<GetQuery, Result<UserDto>>, | ||||
| IRequestHandler<GetAllQuery, Result<IEnumerable<UserDto>>>, | IRequestHandler<GetAllQuery, Result<IEnumerable<UserDto>>>, |
| namespace Diligent.API.Infrastructure.Results | |||||
| namespace Diligent.WebApi.Infrastructure.Results | |||||
| { | { | ||||
| public class Error | public class Error | ||||
| { | { |
| using System.Linq; | using System.Linq; | ||||
| using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
| namespace Diligent.API.Infrastructure.Results | |||||
| namespace Diligent.WebApi.Infrastructure.Results | |||||
| { | { | ||||
| public class Result<TResponse> | public class Result<TResponse> | ||||
| { | { |
| namespace Diligent.API.Models | |||||
| namespace Diligent.WebApi.Models | |||||
| { | { | ||||
| public class AddressDto | public class AddressDto | ||||
| { | { |
| using System.Linq; | using System.Linq; | ||||
| using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
| namespace Diligent.API.Models | |||||
| namespace Diligent.WebApi.Models | |||||
| { | { | ||||
| public class UserDto | public class UserDto | ||||
| { | { |
| namespace Diligent.API.Models.Users | |||||
| namespace Diligent.WebApi.Models.Users | |||||
| { | { | ||||
| public class CreateForm | public class CreateForm | ||||
| { | { |
| using Diligent.API.Infrastructure.Results; | |||||
| using Diligent.WebApi.Infrastructure.Results; | |||||
| using MediatR; | using MediatR; | ||||
| using System; | using System; | ||||
| using System.Collections.Generic; | using System.Collections.Generic; | ||||
| using System.Linq; | using System.Linq; | ||||
| using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
| namespace Diligent.API.Models.Users | |||||
| namespace Diligent.WebApi.Models.Users | |||||
| { | { | ||||
| public class CreateRequest : IRequest<Result<string>> | public class CreateRequest : IRequest<Result<string>> | ||||
| { | { |
| using Diligent.API.Infrastructure.Results; | |||||
| using Diligent.WebApi.Infrastructure.Results; | |||||
| using MediatR; | using MediatR; | ||||
| namespace Diligent.API.Models.Users | |||||
| namespace Diligent.WebApi.Models.Users | |||||
| { | { | ||||
| public class DeleteRequest : IRequest<Result> | public class DeleteRequest : IRequest<Result> | ||||
| { | { |
| using Diligent.API.Infrastructure.Results; | |||||
| using Diligent.WebApi.Infrastructure.Results; | |||||
| using MediatR; | using MediatR; | ||||
| using System.Collections.Generic; | using System.Collections.Generic; | ||||
| namespace Diligent.API.Models.Users | |||||
| namespace Diligent.WebApi.Models.Users | |||||
| { | { | ||||
| public class GetAllQuery : IRequest<Result<IEnumerable<UserDto>>> | public class GetAllQuery : IRequest<Result<IEnumerable<UserDto>>> | ||||
| { | { |
| using Diligent.API.Infrastructure.Results; | |||||
| using Diligent.WebApi.Infrastructure.Results; | |||||
| using MediatR; | using MediatR; | ||||
| using System; | using System; | ||||
| using System.Linq; | using System.Linq; | ||||
| using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
| namespace Diligent.API.Models.Users | |||||
| namespace Diligent.WebApi.Models.Users | |||||
| { | { | ||||
| public class GetQuery : IRequest<Result<UserDto>> | public class GetQuery : IRequest<Result<UserDto>> | ||||
| { | { |
| namespace Diligent.API.Models.Users | |||||
| namespace Diligent.WebApi.Models.Users | |||||
| { | { | ||||
| public class UpdateForm | public class UpdateForm | ||||
| { | { |
| using Diligent.API.Infrastructure.Results; | |||||
| using Diligent.WebApi.Infrastructure.Results; | |||||
| using MediatR; | using MediatR; | ||||
| namespace Diligent.API.Models.Users | |||||
| namespace Diligent.WebApi.Models.Users | |||||
| { | { | ||||
| public class UpdateRequest : IRequest<Result> | public class UpdateRequest : IRequest<Result> | ||||
| { | { |
| using Microsoft.Extensions.Hosting; | using Microsoft.Extensions.Hosting; | ||||
| using Microsoft.Extensions.Logging; | using Microsoft.Extensions.Logging; | ||||
| namespace Diligent.API | |||||
| namespace Diligent.WebApi | |||||
| { | { | ||||
| public class Program | public class Program | ||||
| { | { |
| using Microsoft.OpenApi.Models; | using Microsoft.OpenApi.Models; | ||||
| using Swashbuckle.AspNetCore.SwaggerGen; | using Swashbuckle.AspNetCore.SwaggerGen; | ||||
| namespace Diligent.API | |||||
| namespace Diligent.WebApi | |||||
| { | { | ||||
| public class Startup | public class Startup | ||||
| { | { |