more refactoring

refactor
Don Oerkfitz 2 years ago
parent e6b5eaf851
commit bf60d12a9a

@ -7,9 +7,9 @@ namespace OSI.API.DAL.Base
{
public class MySQL : SQLBase
{
protected MySqlConnection DBConnection {get;set;}
protected MySqlCommand DBCommand {get;set;}
protected MySqlDataReader DBReader {get;set;}
protected MySqlConnection? DBConnection {get;set;}
protected MySqlCommand? DBCommand {get;set;}
protected MySqlDataReader? DBReader {get;set;}
public MySQL(string server, string database, string username, string password)
{

@ -1,9 +1,12 @@
using OSI.API.DAL.Common;
namespace OSI.API.DAL.Client
{
public class ClientObject
{
public int ClientID { get; set; }
public string ClientName { get; set; }
public string? ClientName { get; set; }
public AddressObject? ClientAddress { get; set; }
}
}

@ -12,9 +12,9 @@ namespace OSI.API.DAL.Common
public string CSZ { get => $"{City}, {StateNameFromAbbreviation(State)} {Zip}"; }
private string StateNameFromAbbreviation(string abbr)
private string? StateNameFromAbbreviation(string? abbr)
{
string rv = abbr;
string? rv = abbr;
Dictionary<string, string> states = new Dictionary<string, string>()
{
@ -71,7 +71,7 @@ namespace OSI.API.DAL.Common
{"WY", "Wyoming"}
};
if (states.ContainsKey(abbr))
if ((abbr != null) && states.ContainsKey(abbr))
rv = states[abbr];
return rv;

Loading…
Cancel
Save