Skip to content

Commit

Permalink
clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
samanazadi1996 committed Jun 12, 2024
1 parent c76baff commit 7e136ab
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ namespace CleanArchitecture.Infrastructure.Persistence.Contexts;

public class ApplicationDbContext(DbContextOptions<ApplicationDbContext> options, IAuthenticatedUserService authenticatedUser) : DbContext(options)
{

public DbSet<Product> Products { get; set; }
public override Task<int> SaveChangesAsync(CancellationToken cancellationToken = new CancellationToken())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ public class Translator : ITranslator
{

private readonly ResourceManager resourceMessages;
private readonly ResourceManager propertyName;
private readonly ResourceManager resourceGeneral;

public string this[string name] => propertyName.GetString(name, CultureInfo.CurrentCulture) ?? name;
public string this[string name] => resourceGeneral.GetString(name, CultureInfo.CurrentCulture) ?? name;

public Translator()
{
resourceMessages = new ResourceManager(typeof(ResourceMessages).FullName, typeof(ResourceMessages).Assembly);
propertyName = new ResourceManager(typeof(ResourceGeneral).FullName, typeof(ResourceGeneral).Assembly);
resourceGeneral = new ResourceManager(typeof(ResourceGeneral).FullName, typeof(ResourceGeneral).Assembly);
}
public string GetString(string name)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ public AuthenticatedUserService(IHttpContextAccessor httpContextAccessor)
{
UserId = httpContextAccessor.HttpContext?.User?.FindFirstValue(ClaimTypes.NameIdentifier);
UserName = httpContextAccessor.HttpContext?.User?.Identity.Name;

}

public string UserId { get; }
Expand Down

0 comments on commit 7e136ab

Please sign in to comment.