Skip to content

Commit

Permalink
Linter (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
guibranco authored Aug 25, 2023
1 parent 3976281 commit 1b79278
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
21 changes: 12 additions & 9 deletions examples/dotnet/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,25 @@
class Program
{
private static string fileContent = System.IO.File.ReadAllText("banks.json");
private static List<Bank> banks = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Bank>>(fileContent);
private static List<Bank> banks = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Bank>>(
fileContent
);

static void Main()
{
Console.WriteLine("Hello World!");
Console.WriteLine($"Banks: {banks.Count}");
foreach(var bank in banks)
foreach (var bank in banks)
{
Console.ForegroundColor = ConsoleColor.Magenta;
Console.WriteLine($"{bank.Compe}\t[CNPJ: {bank.Document}]\t{bank.LongName}");
Console.ForegroundColor = ConsoleColor.White;

Console.WriteLine($"\tTipo: {bank.Type ?? ""}");
Console.WriteLine($"\tBoleto: {bank.Charge??false}");
Console.WriteLine($"\tTED/DOC: {bank.CreditDocument??false}");
Console.WriteLine($"\tPIX: {bank.PixType??"False"}");
Console.WriteLine($"\tPortabilidade: {bank.SalaryPortability??"False"}");
Console.WriteLine($"\tBoleto: {bank.Charge ?? false}");
Console.WriteLine($"\tTED/DOC: {bank.CreditDocument ?? false}");
Console.WriteLine($"\tPIX: {bank.PixType ?? "False"}");
Console.WriteLine($"\tPortabilidade: {bank.SalaryPortability ?? "False"}");
Console.WriteLine($"\tAtualizado em: {bank.DateUpdated}\n");
}

Expand All @@ -39,7 +42,7 @@ private static void FilterBanks(string compe)

var sortedBanks = banks.Where(b => b.Compe == compe);

if (sortedBanks.Count() != 0)
if (sortedBanks.Count() != 0)
{
foreach (var bank in sortedBanks)
{
Expand All @@ -63,12 +66,12 @@ private static void FilterBanks(string compe)
Console.Write("1.Listar Todos \t 2.Buscar COMPE: ");
int option = Convert.ToInt32(Console.ReadLine());

if(option == 1)
if (option == 1)
{
Console.Clear();
Main();
}
if(option == 2)
if (option == 2)
{
Console.Clear();
Console.Write("Buscar COMPE (3 dígitos): ");
Expand Down
2 changes: 1 addition & 1 deletion schemas/csharp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class Bank
public string PixType { get; set; }

[JsonProperty("Charge")]
public bool? Charge { get; set;}
public bool? Charge { get; set; }

[JsonProperty("CreditDocument")]
public bool? CreditDocument { get; set; }
Expand Down

0 comments on commit 1b79278

Please sign in to comment.