-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
83 changed files
with
2,429 additions
and
2,512 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
using Microsoft.AspNetCore.Authorization; | ||
|
||
namespace Orion.Api.Attributes | ||
namespace Orion.Api.Attributes; | ||
|
||
public class AuthorizeForAttribute : AuthorizeAttribute | ||
{ | ||
public class AuthorizeForAttribute : AuthorizeAttribute | ||
public AuthorizeForAttribute(params string[] roles) | ||
{ | ||
public AuthorizeForAttribute(params string[] roles) | ||
{ | ||
Roles = string.Join(",", roles); | ||
} | ||
Roles = string.Join(",", roles); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
using AutoMapper; | ||
using Orion.Api.AutoMapper.Config; | ||
|
||
namespace Orion.Api.AutoMapper | ||
namespace Orion.Api.AutoMapper; | ||
|
||
public static class AutoMapperConfiguration | ||
{ | ||
public static class AutoMapperConfiguration | ||
public static void ConfigureAutoMapper(this IServiceCollection services) | ||
{ | ||
public static void ConfigureAutoMapper(this IServiceCollection services) | ||
var mappingConfig = new MapperConfiguration(mc => | ||
{ | ||
var mappingConfig = new MapperConfiguration(mc => | ||
{ | ||
mc.AddProfile(new InputToDomainProfile()); | ||
mc.AddProfile(new DomainToOutputProfile()); | ||
}); | ||
mc.AddProfile(new InputToDomainProfile()); | ||
mc.AddProfile(new DomainToOutputProfile()); | ||
}); | ||
|
||
services.AddScoped(_ => mappingConfig.CreateMapper()); | ||
} | ||
services.AddScoped(_ => mappingConfig.CreateMapper()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
namespace Orion.Api.AutoMapper.Input | ||
namespace Orion.Api.AutoMapper.Input; | ||
|
||
public class CustomerInput | ||
{ | ||
public class CustomerInput | ||
{ | ||
public string PublicId { get; set; } | ||
public string Name { get; set; } | ||
} | ||
public string PublicId { get; set; } | ||
public string Name { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
using Orion.Domain.Entities.Enuns; | ||
|
||
namespace Orion.Api.AutoMapper.Input | ||
namespace Orion.Api.AutoMapper.Input; | ||
|
||
public class UserInput | ||
{ | ||
public class UserInput | ||
{ | ||
public string PublicId { get; set; } | ||
public string Name { get; set; } | ||
public string Email { get; set; } | ||
public string Password { get; set; } | ||
public UserProfile Profile { get; set; } | ||
} | ||
public string PublicId { get; set; } | ||
public string Name { get; set; } | ||
public string Email { get; set; } | ||
public string Password { get; set; } | ||
public UserProfile Profile { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
namespace Orion.Api.AutoMapper.Output | ||
namespace Orion.Api.AutoMapper.Output; | ||
|
||
public class CustomerOutput | ||
{ | ||
public class CustomerOutput | ||
{ | ||
public string PublicId { get; set; } | ||
public string Name { get; set; } | ||
public DateTime LastUpdated { get; set; } | ||
public DateTime CreatedAt { get; set; } | ||
} | ||
public string PublicId { get; set; } | ||
public string Name { get; set; } | ||
public DateTime LastUpdated { get; set; } | ||
public DateTime CreatedAt { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 10 additions & 11 deletions
21
src/Orion.Api/Configuration/ApiVersioningConfiguration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
using Microsoft.AspNetCore.Mvc.Versioning; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace Orion.Api.Configuration | ||
namespace Orion.Api.Configuration; | ||
|
||
public static class ApiVersioningConfiguration | ||
{ | ||
public static class ApiVersioningConfiguration | ||
public static void ConfigureApiVersioning(this IServiceCollection services) | ||
{ | ||
public static void ConfigureApiVersioning(this IServiceCollection services) | ||
services.AddApiVersioning(o => | ||
{ | ||
services.AddApiVersioning(o => | ||
{ | ||
o.ReportApiVersions = true; | ||
o.AssumeDefaultVersionWhenUnspecified = true; | ||
o.DefaultApiVersion = new ApiVersion(1, 0); | ||
o.ApiVersionReader = new HeaderApiVersionReader("x-api-version"); | ||
}); | ||
} | ||
o.ReportApiVersions = true; | ||
o.AssumeDefaultVersionWhenUnspecified = true; | ||
o.DefaultApiVersion = new ApiVersion(1, 0); | ||
o.ApiVersionReader = new HeaderApiVersionReader("x-api-version"); | ||
}); | ||
} | ||
} |
Oops, something went wrong.