Skip to content

Commit

Permalink
cleanup: centralize models-library using statements in a globalusings…
Browse files Browse the repository at this point in the history
….cs file

this way it's easier to maintain when upgrading to use a newer version of the models

in the mvc frontend, there's two places where updates would have to be made:
- globalusings.cs
- _viewimports.cshtml

as for the rest, the globalusings.cs is the only place
  • Loading branch information
ShaylenReddy42 committed Nov 3, 2022
1 parent 0f3b6d6 commit 4c43efc
Show file tree
Hide file tree
Showing 35 changed files with 21 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using SeelansTyres.Frontends.Mvc.Models;
using SeelansTyres.Frontends.Mvc.Services;
using SeelansTyres.Frontends.Mvc.ViewModels;
using SeelansTyres.Models.IdentityModels.V1;
using System.Diagnostics;
using System.Security.Cryptography;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using SeelansTyres.Frontends.Mvc.Models;
using SeelansTyres.Frontends.Mvc.Services;
using SeelansTyres.Frontends.Mvc.ViewModels;
using SeelansTyres.Models.TyresModels.V1;
using System.Diagnostics;

namespace SeelansTyres.Frontends.Mvc.Controllers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using SeelansTyres.Frontends.Mvc.Models;
using SeelansTyres.Frontends.Mvc.Services;
using SeelansTyres.Frontends.Mvc.ViewModels;
using SeelansTyres.Models.OrderModels.V1;
using System.Diagnostics;
using System.Reflection;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
global using SeelansTyres.Models.AddressModels.V1;
global using SeelansTyres.Models.IdentityModels.V1;
global using SeelansTyres.Models.OrderModels.V1;
global using SeelansTyres.Models.TyresModels.V1;
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using SeelansTyres.Models.AddressModels.V1;

namespace SeelansTyres.Frontends.Mvc.Services;
namespace SeelansTyres.Frontends.Mvc.Services;

public class AddressService : IAddressService
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using IdentityModel.Client;
using Microsoft.Extensions.Caching.Memory;
using SeelansTyres.Frontends.Mvc.Extensions;
using SeelansTyres.Models.IdentityModels.V1;
using System.Diagnostics;

namespace SeelansTyres.Frontends.Mvc.Services;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using FluentEmail.Core;
using SeelansTyres.Models.OrderModels.V1;
using System.Diagnostics;
using System.Reflection;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using SeelansTyres.Models.AddressModels.V1;

namespace SeelansTyres.Frontends.Mvc.Services;
namespace SeelansTyres.Frontends.Mvc.Services;

public interface IAddressService
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using SeelansTyres.Models.IdentityModels.V1;

namespace SeelansTyres.Frontends.Mvc.Services;
namespace SeelansTyres.Frontends.Mvc.Services;

public interface ICustomerService
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using SeelansTyres.Models.OrderModels.V1;

namespace SeelansTyres.Frontends.Mvc.Services;
namespace SeelansTyres.Frontends.Mvc.Services;

public interface IEmailService
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using SeelansTyres.Models.OrderModels.V1;

namespace SeelansTyres.Frontends.Mvc.Services;
namespace SeelansTyres.Frontends.Mvc.Services;

public interface IOrderService
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using SeelansTyres.Models.TyresModels.V1;

namespace SeelansTyres.Frontends.Mvc.Services;
namespace SeelansTyres.Frontends.Mvc.Services;

public interface ITyresService
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using SeelansTyres.Models.OrderModels.V1;

namespace SeelansTyres.Frontends.Mvc.Services;
namespace SeelansTyres.Frontends.Mvc.Services;

public class OrderService : IOrderService
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using SeelansTyres.Models.TyresModels.V1;

namespace SeelansTyres.Frontends.Mvc.Services;
namespace SeelansTyres.Frontends.Mvc.Services;

public class TyresService : ITyresService
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using SeelansTyres.Models.AddressModels.V1;
using SeelansTyres.Models.IdentityModels.V1;
using SeelansTyres.Models.OrderModels.V1;

namespace SeelansTyres.Frontends.Mvc.ViewModels;
namespace SeelansTyres.Frontends.Mvc.ViewModels;

public class AccountViewModel
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using SeelansTyres.Models.OrderModels.V1;
using SeelansTyres.Models.TyresModels.V1;

namespace SeelansTyres.Frontends.Mvc.ViewModels;
namespace SeelansTyres.Frontends.Mvc.ViewModels;

public class AdminPortalViewModel
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using SeelansTyres.Data.AddressData.Entities;
using SeelansTyres.Models.AddressModels.V1;

namespace SeelansTyres.Services.AddressService.Controllers;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global using SeelansTyres.Models.AddressModels.V1;
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using AutoMapper;
using SeelansTyres.Data.AddressData.Entities;
using SeelansTyres.Models.AddressModels.V1;

namespace SeelansTyres.Services.AddressService.Profiles;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using SeelansTyres.Libraries.Shared.Messages;
using SeelansTyres.Libraries.Shared.Models;
using SeelansTyres.Libraries.Shared.Services;
using SeelansTyres.Models.IdentityModels.V1;
using SeelansTyres.Services.IdentityService.Data.Entities;
using SeelansTyres.Services.IdentityService.Extensions;
using SeelansTyres.Services.IdentityService.Services;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global using SeelansTyres.Models.IdentityModels.V1;
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using AutoMapper;
using SeelansTyres.Models.IdentityModels.V1;
using SeelansTyres.Services.IdentityService.Data.Entities;

namespace SeelansTyres.Services.IdentityService.Profiles;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Microsoft.AspNetCore.Identity;
using SeelansTyres.Models.IdentityModels.V1;
using SeelansTyres.Services.IdentityService.Data.Entities;
using System.Diagnostics;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using SeelansTyres.Models.IdentityModels.V1;
using SeelansTyres.Services.IdentityService.Data.Entities;
using SeelansTyres.Services.IdentityService.Data.Entities;

namespace SeelansTyres.Services.IdentityService.Services;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SeelansTyres.Data.OrderData.Entities;
using SeelansTyres.Models.OrderModels.V1;
using SeelansTyres.Services.OrderService.Services;

namespace SeelansTyres.Services.OrderService.Controllers;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global using SeelansTyres.Models.OrderModels.V1;
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using AutoMapper;
using SeelansTyres.Data.OrderData.Entities;
using SeelansTyres.Models.OrderModels.V1;

namespace SeelansTyres.Services.OrderService.Profiles;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using AutoMapper;
using SeelansTyres.Data.OrderData.Entities;
using SeelansTyres.Models.OrderModels.V1;

namespace SeelansTyres.Services.OrderService.Profiles
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
global using SeelansTyres.Models.IdentityModels.V1;
global using SeelansTyres.Models.TyresModels.V1;
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using Microsoft.EntityFrameworkCore;
using SeelansTyres.Data.OrderData;
using SeelansTyres.Libraries.Shared.Messages;
using SeelansTyres.Models.IdentityModels.V1;
using SeelansTyres.Models.TyresModels.V1;
using System.Diagnostics;
using System.Text.Json;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using Microsoft.AspNetCore.Mvc;
using SeelansTyres.Services.TyresService.Services;
using SeelansTyres.Services.TyresService.Data.Entities;
using SeelansTyres.Models.TyresModels.V1;

namespace SeelansTyres.Services.TyresService.Controllers;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using SeelansTyres.Libraries.Shared.Messages;
using System.Diagnostics;
using System.Text.Json;
using SeelansTyres.Models.TyresModels.V1;

namespace SeelansTyres.Services.TyresService.Controllers;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global using SeelansTyres.Models.TyresModels.V1;
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using AutoMapper;
using SeelansTyres.Models.TyresModels.V1;
using SeelansTyres.Services.TyresService.Data.Entities;

namespace SeelansTyres.Services.TyresService.Profiles;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using AutoMapper;
using SeelansTyres.Services.TyresService.Data.Entities;
using SeelansTyres.Models.TyresModels.V1;

namespace SeelansTyres.Services.TyresService.Profiles;

Expand Down

0 comments on commit 4c43efc

Please sign in to comment.