Skip to content
This repository has been archived by the owner on Aug 31, 2020. It is now read-only.

Commit

Permalink
style(app): sort and remove unused usings (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
skyfrk authored Aug 29, 2020
1 parent 3fffa26 commit 63aed94
Show file tree
Hide file tree
Showing 79 changed files with 43 additions and 255 deletions.
6 changes: 1 addition & 5 deletions src/app/TicketStore.Client.App/Command.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace TicketStore.Client.App
namespace TicketStore.Client.App
{
/// <summary>
/// Available commands.
Expand Down
5 changes: 1 addition & 4 deletions src/app/TicketStore.Client.App/CommandLineOptions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using CommandLine;
using System;
using System.Collections.Generic;
using System.Text;

namespace TicketStore.Client.App
{
Expand All @@ -22,7 +19,7 @@ public class CommandLineOptions
[Option('c', "command", Required = true, HelpText = "Command to be executed. Run command 'List' for a list of all available commands.")]
public Command Command { get; }

[Option('s',"show-logs", Default = false, Required = false, HelpText = "Shows log messages directly in the console.")]
[Option('s', "show-logs", Default = false, Required = false, HelpText = "Shows log messages directly in the console.")]
public bool ShowLogs { get; }

public CommandLineOptions(bool verbose, string host, bool admin, Command command, bool showLogs)
Expand Down
7 changes: 3 additions & 4 deletions src/app/TicketStore.Client.App/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
using Akka.Configuration;
using CommandLine;
using Serilog;
using Sharprompt;
using Sharprompt.Validations;
using System;
using System.Collections.Generic;
using System.IO;
Expand Down Expand Up @@ -36,7 +34,7 @@ static void Main(string[] args)

static void RunWithOptions(CommandLineOptions opts)
{
if(opts.Command == Command.List)
if (opts.Command == Command.List)
{
Console.WriteLine("Available commands:");
var commandTypes = Enum.GetValues(typeof(Command)).Cast<Command>();
Expand Down Expand Up @@ -89,7 +87,8 @@ static void RunWithOptions(CommandLineOptions opts)
{
loggerBuilder = loggerBuilder.MinimumLevel.Verbose();
akkaConfig = akkaConfig.Replace("loglevel=INFO", "loglevel=DEBUG", StringComparison.Ordinal);
} else
}
else
{
loggerBuilder = loggerBuilder.MinimumLevel.Information();
}
Expand Down
5 changes: 0 additions & 5 deletions src/app/TicketStore.Client.Logic/ClientActor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
using Akka.Event;
using Akka.Util.Internal;
using BetterConsoleTables;
using Sharprompt;
using Sharprompt.Validations;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices.ComTypes;
using System.Text;
using System.Text.Json;
using TicketStore.Client.Logic.Messages;
using TicketStore.Client.Logic.Util;
Expand Down
2 changes: 0 additions & 2 deletions src/app/TicketStore.Client.Logic/Config.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace TicketStore.Client.Logic
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using TicketStore.Shared.Models;
using TicketStore.Shared.Models;

namespace TicketStore.Client.Logic.Messages
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace TicketStore.Client.Logic.Messages
namespace TicketStore.Client.Logic.Messages
{
/// <summary>
/// Get all events message.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace TicketStore.Client.Logic.Messages
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace TicketStore.Client.Logic.Messages
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace TicketStore.Client.Logic.Messages
namespace TicketStore.Client.Logic.Messages
{
/// <summary>
/// Get remaining budget for current year message.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace TicketStore.Client.Logic.Messages
{
Expand Down
7 changes: 2 additions & 5 deletions src/app/TicketStore.Client.Logic/Messages/InitStateMessage.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using TicketStore.Shared.Models;
using TicketStore.Shared.Models;

namespace TicketStore.Client.Logic.Messages
{
Expand All @@ -13,7 +10,7 @@ public class InitStateMessage
/// <summary>
/// User to be created.
/// </summary>
public UserDto UserDto{ get; }
public UserDto UserDto { get; }

/// <summary>
/// Constructor.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace TicketStore.Client.Logic.Messages
namespace TicketStore.Client.Logic.Messages
{
/// <summary>
/// Persist state messsage.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace TicketStore.Client.Logic.Messages
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace TicketStore.Client.Logic.Messages
namespace TicketStore.Client.Logic.Messages
{
/// <summary>
/// Restore state message.
Expand Down
4 changes: 1 addition & 3 deletions src/app/TicketStore.Client.Logic/Util/Ask.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using Sharprompt;
using Sharprompt.Validations;
using System;
using System.Collections.Generic;
using System.Text;
using TicketStore.Shared.Models;

namespace TicketStore.Client.Logic.Util
Expand Down Expand Up @@ -100,7 +98,7 @@ public static int ForTicketCount()
/// <returns>Event id.</returns>
public static Guid ForEventId()
{
var guidStr = Prompt.Input<string>("EventId?", null, new[] { Validators.Required(), Validators.RegularExpression(@"(?im)^[{(]?[0-9A-F]{8}[-]?(?:[0-9A-F]{4}[-]?){3}[0-9A-F]{12}[)}]?$") });
var guidStr = Prompt.Input<string>("EventId?", null, new[] { Validators.Required(), Validators.RegularExpression(@"(?im)^[{(]?[0-9A-F]{8}[-]?(?:[0-9A-F]{4}[-]?){3}[0-9A-F]{12}[)}]?$") });
return Guid.Parse(guidStr);
}

Expand Down
6 changes: 1 addition & 5 deletions src/app/TicketStore.Client.Logic/Util/IJsonDataStore.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace TicketStore.Client.Logic.Util
namespace TicketStore.Client.Logic.Util
{
/// <summary>
/// Read or write an object to a file.
Expand Down
7 changes: 2 additions & 5 deletions src/app/TicketStore.Client.Logic/Util/JsonDataStore.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.IO;
using System.Text.Json;

namespace TicketStore.Client.Logic.Util
Expand All @@ -22,7 +19,7 @@ public JsonDataStore(string pathToJson)
_pathToJson = pathToJson;
}


/// <inheritdoc/>
public T Read<T>()
{
Expand Down
7 changes: 2 additions & 5 deletions src/app/TicketStore.Server.App/CommandLineOptions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using CommandLine;
using System;
using System.Collections.Generic;
using System.Text;

namespace TicketStore.Server.App
{
Expand All @@ -19,8 +16,8 @@ public class CommandLineOptions
[Option('a', "actor-instance-count", Default = 5, Required = false, HelpText = "The number of instances for each stateless actor.")]
public int ActorInstanceCount { get; }

[Option('r',"reset", Default = false, Required = false, HelpText = "Wipes the database.")]
public bool Reset { get; }
[Option('r', "reset", Default = false, Required = false, HelpText = "Wipes the database.")]
public bool Reset { get; }

public CommandLineOptions(bool verbose, string port, int actorInstanceCount, bool reset)
{
Expand Down
5 changes: 1 addition & 4 deletions src/app/TicketStore.Server.App/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using TicketStore.Server.Logic;
using TicketStore.Server.Logic.Actors;
using TicketStore.Server.Logic.DataAccess;
using TicketStore.Server.Logic.DataAccess.Contracts;
using TicketStore.Shared;

namespace TicketStore.Server.App
Expand All @@ -31,7 +28,7 @@ static void Main(string[] args)
.WithParsed<CommandLineOptions>(RunWithOptions)
.WithNotParsed(HandleParseErrors);
}

static void RunWithOptions(CommandLineOptions opts)
{
var appDataDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData, Environment.SpecialFolderOption.DoNotVerify), "TicketStore", "Server");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
using Microsoft.EntityFrameworkCore;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TicketStore.Server.Logic.DataAccess;
using TicketStore.Server.Logic.DataAccess.Entities;
Expand Down
4 changes: 0 additions & 4 deletions src/app/TicketStore.Server.Logic/Actors/EventActor.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
using Akka.Actor;
using Akka.Event;
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TicketStore.Server.Logic.DataAccess.Contracts;
using TicketStore.Server.Logic.Messages;
using TicketStore.Server.Logic.Messages.Requests;
using TicketStore.Server.Logic.Messages.Responses;
using TicketStore.Server.Logic.Util;
Expand Down
4 changes: 1 addition & 3 deletions src/app/TicketStore.Server.Logic/Actors/UserActor.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using Akka.Actor;
using Akka.Event;
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TicketStore.Server.Logic.DataAccess.Contracts;
using TicketStore.Server.Logic.Messages.Requests;
Expand Down Expand Up @@ -124,7 +122,7 @@ private static ImmutableList<RichTicketDto> FilterRichTicketDtos(ImmutableList<R
{
if (ticketFilter == null) return richTicketDtos;

if(ticketFilter.Criterion == QueryCriterion.EventDate)
if (ticketFilter.Criterion == QueryCriterion.EventDate)
{
return richTicketDtos.Where(t => t.EventDto.Date.Day == ticketFilter.Date.Day).ToImmutableList();
}
Expand Down
7 changes: 1 addition & 6 deletions src/app/TicketStore.Server.Logic/Actors/WriteToDbActor.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
using Akka.Actor;
using Akka.Event;
using Akka.Util.Internal;
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TicketStore.Server.Logic.DataAccess;
using TicketStore.Server.Logic.DataAccess.Contracts;
using TicketStore.Server.Logic.DataAccess.Entities;
using TicketStore.Server.Logic.Messages;
using TicketStore.Server.Logic.Messages.Requests;
using TicketStore.Server.Logic.Messages.Responses;
using TicketStore.Server.Logic.Util;
using TicketStore.Shared.Messages;
using TicketStore.Shared.Models;

namespace TicketStore.Server.Logic.Actors
Expand Down Expand Up @@ -105,7 +100,7 @@ private async Task ProcessMessageAsync(AddTicketsToDbRequest msg)
return;
}

if(!_repo.Users.FindByCondition(u => u.Id == msg.UserId).Any())
if (!_repo.Users.FindByCondition(u => u.Id == msg.UserId).Any())
{
_logger.Warning("User with id {eventId} does not exist!", msg.UserId);
Sender.Tell(new AddTicketsToDbResponse(msg.RequestId, null, $"User with id {msg.UserId} does not exist!"));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using TicketStore.Server.Logic.DataAccess.Contracts;
using TicketStore.Server.Logic.DataAccess.Contracts;
using TicketStore.Server.Logic.DataAccess.Entities;

namespace TicketStore.Server.Logic.DataAccess
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using TicketStore.Server.Logic.DataAccess.Entities;
using TicketStore.Server.Logic.DataAccess.Entities;

namespace TicketStore.Server.Logic.DataAccess.Contracts
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using TicketStore.Server.Logic.DataAccess.Entities;
using TicketStore.Server.Logic.DataAccess.Entities;

namespace TicketStore.Server.Logic.DataAccess.Contracts
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace TicketStore.Server.Logic.DataAccess.Contracts
namespace TicketStore.Server.Logic.DataAccess.Contracts
{
/// <summary>
/// Readonly wrapper around all repositories for easier access.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

namespace TicketStore.Server.Logic.DataAccess.Contracts
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using System.Threading.Tasks;

namespace TicketStore.Server.Logic.DataAccess.Contracts
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using TicketStore.Server.Logic.DataAccess.Entities;
using TicketStore.Server.Logic.DataAccess.Entities;

namespace TicketStore.Server.Logic.DataAccess.Contracts
{
Expand Down
Loading

0 comments on commit 63aed94

Please sign in to comment.