Skip to content

Commit

Permalink
update to VS 16.3
Browse files Browse the repository at this point in the history
  • Loading branch information
olmobrutall committed Sep 25, 2019
1 parent a244a79 commit 3c0bf87
Show file tree
Hide file tree
Showing 47 changed files with 114 additions and 114 deletions.
14 changes: 6 additions & 8 deletions Signum.Engine/Basics/ExceptionLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ namespace Signum.Engine.Basics
{
public static class ExceptionLogic
{
public static Func<string> GetCurrentVersion;

public static void Start(SchemaBuilder sb)
{
if (sb.NotDefined(MethodInfo.GetCurrentMethod()))
Expand Down Expand Up @@ -111,21 +109,21 @@ static ExceptionEntity SaveForceNew(this ExceptionEntity entity)
}
}

public static string DefaultEnvironment { get; set; }
public static string? DefaultEnvironment { get; set; }

public static string CurrentEnvironment { get { return overridenEnvironment.Value ?? DefaultEnvironment; } }
public static string? CurrentEnvironment { get { return overridenEnvironment.Value ?? DefaultEnvironment; } }

static readonly Variable<string> overridenEnvironment = Statics.ThreadVariable<string>("exceptionEnviroment");
static readonly Variable<string?> overridenEnvironment = Statics.ThreadVariable<string?>("exceptionEnviroment");

public static IDisposable OverrideEnviroment(string newEnviroment)
public static IDisposable OverrideEnviroment(string? newEnviroment)
{
string oldEnviroment = overridenEnvironment.Value;
string? oldEnviroment = overridenEnvironment.Value;
overridenEnvironment.Value = newEnviroment;
return new Disposable(() => overridenEnvironment.Value = oldEnviroment);
}


public static event Action<DeleteLogParametersEmbedded, StringBuilder, CancellationToken> DeleteLogs;
public static event Action<DeleteLogParametersEmbedded, StringBuilder, CancellationToken>? DeleteLogs;

public static int DeleteLogsTimeOut = 10 * 60 * 1000;

Expand Down
2 changes: 1 addition & 1 deletion Signum.Engine/Basics/PropertyRouteLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static class PropertyRouteLogic
public static bool IsPropertyRoute(this PropertyRouteEntity prdn, PropertyRoute pr) =>
As.Expression(() => prdn.RootType == pr.RootType.ToTypeEntity() && prdn.Path == pr.PropertyString());

public static ResetLazy<Dictionary<TypeEntity, Dictionary<string, PropertyRouteEntity>>> Properties;
public static ResetLazy<Dictionary<TypeEntity, Dictionary<string, PropertyRouteEntity>>> Properties = null!;

public static void Start(SchemaBuilder sb)
{
Expand Down
4 changes: 2 additions & 2 deletions Signum.Engine/Basics/QueryLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ namespace Signum.Engine.Basics
{
public static class QueryLogic
{
static ResetLazy<Dictionary<string, object>> queryNamesLazy;
static ResetLazy<Dictionary<string, object>> queryNamesLazy = null!;
public static Dictionary<string, object> QueryNames => queryNamesLazy.Value;

static ResetLazy<Dictionary<object, QueryEntity>> queryNameToEntityLazy;
static ResetLazy<Dictionary<object, QueryEntity>> queryNameToEntityLazy = null!;
public static Dictionary<object, QueryEntity> QueryNameToEntity => queryNameToEntityLazy.Value;

public static DynamicQueryContainer Queries { get; } = new DynamicQueryContainer();
Expand Down
4 changes: 2 additions & 2 deletions Signum.Engine/Basics/SemiSymbolLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ namespace Signum.Engine.Extensions.Basics
public static class SemiSymbolLogic<T>
where T : SemiSymbol
{
static ResetLazy<Dictionary<string, T>> lazy;
static Func<IEnumerable<T>> getSemiSymbols;
static ResetLazy<Dictionary<string, T>> lazy = null!;
static Func<IEnumerable<T>> getSemiSymbols = null!;

[ThreadStatic]
static bool avoidCache;
Expand Down
6 changes: 3 additions & 3 deletions Signum.Engine/Basics/SymbolLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Signum.Engine

public static class SymbolLogic
{
public static event Action OnLoadAll;
public static event Action? OnLoadAll;

public static void LoadAll()
{
Expand All @@ -23,8 +23,8 @@ public static void LoadAll()
public static class SymbolLogic<T>
where T: Symbol
{
static ResetLazy<Dictionary<string, T>> lazy;
static Func<IEnumerable<T>> getSymbols;
static ResetLazy<Dictionary<string, T>> lazy = null!;
static Func<IEnumerable<T>> getSymbols = null!;

[ThreadStatic]
static bool avoidCache;
Expand Down
2 changes: 1 addition & 1 deletion Signum.Engine/Connection/Connector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static Connector Current
get { return currentConnector.Value ?? Default; }
}

static Connector @default;
static Connector @default = null!;
public static Connector Default
{
get { return @default; }
Expand Down
26 changes: 13 additions & 13 deletions Signum.Engine/Connection/Transaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ public class Transaction : IDisposableException

interface ICoreTransaction
{
event Action<Dictionary<string, object>?> PostRealCommit;
event Action<Dictionary<string, object>?>? PostRealCommit;
void CallPostRealCommit();
event Action<Dictionary<string, object>?> PreRealCommit;
event Action<Dictionary<string, object>?>? PreRealCommit;
DbConnection? Connection { get; }
DbTransaction? Transaction { get; }

Expand Down Expand Up @@ -60,13 +60,13 @@ public FakedTransaction(ICoreTransaction parent)
this.parent = parent;
}

public event Action<Dictionary<string, object>?> PostRealCommit
public event Action<Dictionary<string, object>?>? PostRealCommit
{
add { parent.PostRealCommit += value; }
remove { parent.PostRealCommit -= value; }
}

public event Action<Dictionary<string, object>?> PreRealCommit
public event Action<Dictionary<string, object>?>? PreRealCommit
{
add { parent.PreRealCommit += value; }
remove { parent.PreRealCommit -= value; }
Expand Down Expand Up @@ -118,9 +118,9 @@ class RealTransaction : ICoreTransaction
public DbTransaction? Transaction { get; private set; }
public Exception? IsRolledback { get; private set; }
public bool Started { get; private set; }
public event Action<Dictionary<string, object>?> PostRealCommit;
public event Action<Dictionary<string, object>?> PreRealCommit;
public event Action<Dictionary<string, object>?> Rolledback;
public event Action<Dictionary<string, object>?>? PostRealCommit;
public event Action<Dictionary<string, object>?>? PreRealCommit;
public event Action<Dictionary<string, object>?>? Rolledback;

IsolationLevel? IsolationLevel;

Expand Down Expand Up @@ -219,10 +219,10 @@ class NamedTransaction : ICoreTransaction
string savePointName;
public Exception? IsRolledback { get; private set; }
public bool Started { get; private set; }
public event Action<Dictionary<string, object>?> PostRealCommit;
public event Action<Dictionary<string, object>?>? PostRealCommit;

public event Action<Dictionary<string, object>?> PreRealCommit;
public event Action<Dictionary<string, object>?> Rolledback;
public event Action<Dictionary<string, object>?>? PreRealCommit;
public event Action<Dictionary<string, object>?>? Rolledback;

public NamedTransaction(ICoreTransaction parent, string savePointName)
{
Expand Down Expand Up @@ -297,9 +297,9 @@ class NoneTransaction : ICoreTransaction
public DbTransaction? Transaction { get { return null; } }
public Exception? IsRolledback { get; private set; }
public bool Started { get; private set; }
public event Action<Dictionary<string, object>?> PostRealCommit;
public event Action<Dictionary<string, object>?> PreRealCommit;
public event Action<Dictionary<string, object>?> Rolledback;
public event Action<Dictionary<string, object>?>? PostRealCommit;
public event Action<Dictionary<string, object>?>? PreRealCommit;
public event Action<Dictionary<string, object>?>? Rolledback;

public NoneTransaction(ICoreTransaction? parent)
{
Expand Down
4 changes: 2 additions & 2 deletions Signum.Engine/DynamicQuery/DynamicQueryContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ async Task<T> ExecuteAsync<T>(ExecuteType executeType, object queryName, BaseQue
}
}

public event Func<ExecuteType, object, BaseQueryRequest?, IDisposable?> QueryExecuted;
public event Func<ExecuteType, object, BaseQueryRequest?, IDisposable?>? QueryExecuted;

public enum ExecuteType
{
Expand Down Expand Up @@ -166,7 +166,7 @@ public DQueryable<object> GetDQueryable(DQueryableRequest request)
return Execute(ExecuteType.GetDQueryable, request.QueryName, null, dqb => dqb.Core.Value.GetDQueryable(request));
}

public event Func<object, bool, bool> AllowQuery;
public event Func<object, bool, bool>? AllowQuery;

public bool QueryAllowed(object queryName, bool fullScreen)
{
Expand Down
2 changes: 1 addition & 1 deletion Signum.Engine/Engine/SchemaSynchronizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static class SchemaSynchronizer
{
public static Func<SchemaName, bool> DropSchema = s => !s.Name.Contains(@"\");

public static Action<Dictionary<string, DiffTable>> SimplifyDiffTables;
public static Action<Dictionary<string, DiffTable>>? SimplifyDiffTables;

public static SqlPreCommand? SynchronizeTablesScript(Replacements replacements)
{
Expand Down
4 changes: 2 additions & 2 deletions Signum.Engine/Engine/SqlBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,9 @@ public static int DuplicateCount(UniqueIndex uniqueIndex, Replacements rep)
(
SELECT MIN({oldPrimaryKey})
FROM {oldTableName}
{(string.IsNullOrWhiteSpace(uniqueIndex.Where) ? "" : "WHERE " + uniqueIndex.Where.Replace(columnReplacement))}
{(!uniqueIndex.Where.HasText() ? "" : "WHERE " + uniqueIndex.Where.Replace(columnReplacement))}
GROUP BY {oldColumns}
){(string.IsNullOrWhiteSpace(uniqueIndex.Where) ? "" : "AND " + uniqueIndex.Where.Replace(columnReplacement))}")!;
){(!uniqueIndex.Where.HasText() ? "" : "AND " + uniqueIndex.Where.Replace(columnReplacement))}")!;
}

public static SqlPreCommand? RemoveDuplicatesIfNecessary(UniqueIndex uniqueIndex, Replacements rep)
Expand Down
2 changes: 1 addition & 1 deletion Signum.Engine/Engine/Synchronizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public AutoReplacementContext(string replacementKey, string oldValue, List<strin
}
}

public static Func<AutoReplacementContext, Selection?> AutoReplacement;
public static Func<AutoReplacementContext, Selection?>? AutoReplacement;

private static Selection SelectInteractive(string oldValue, List<string> newValues, string replacementsKey, bool interactive)
{
Expand Down
2 changes: 1 addition & 1 deletion Signum.Engine/EntityCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public static T Construct<T>(PrimaryKey id) where T : Entity

static class Constructor<T> where T : Entity
{
static Func<T> call;
static Func<T>? call;
public static Func<T> Call
{
get
Expand Down
2 changes: 1 addition & 1 deletion Signum.Engine/Linq/AliasGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public Alias NextTableAlias(string tableName)
string? abv = tableName.Any(char.IsUpper) ? new string(tableName.Where(c => char.IsUpper(c)).ToArray()) :
tableName.Any(a => a == '_') ? new string(tableName.SplitNoEmpty('_' ).Select(s => s[0]).ToArray()) : null;

if (string.IsNullOrEmpty(abv))
if (!abv.HasText())
abv = tableName.TryStart(3)!;
else
abv = abv.ToLower();
Expand Down
8 changes: 4 additions & 4 deletions Signum.Engine/Operations/GraphState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ protected Graph()
throw new InvalidOperationException("OperationGraphs should not be instantiated");
}

static Expression<Func<T, S>> getState;
static Expression<Func<T, S>> getState = null!;
public static Expression<Func<T, S>> GetState
{
get { return getState; }
Expand All @@ -292,11 +292,11 @@ public static Expression<Func<T, S>> GetState
}
}

public static Func<T, S> GetStateFunc{get; private set;}
public static Func<T, S> GetStateFunc { get; private set; } = null!;


public static Action<T, S> EnterState { get; set; }
public static Action<T, S> ExitState { get; set; }
public static Action<T, S>? EnterState { get; set; }
public static Action<T, S>? ExitState { get; set; }



Expand Down
4 changes: 2 additions & 2 deletions Signum.Engine/Operations/OperationLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ static void EntityEventsGlobal_Saving(Entity ident)

#region Events

public static event SurroundOperationHandler SurroundOperation;
public static event AllowOperationHandler AllowOperation;
public static event SurroundOperationHandler? SurroundOperation;
public static event AllowOperationHandler? AllowOperation;

internal static IDisposable? OnSuroundOperation(IOperation operation, OperationLogEntity log, IEntity? entity, object[]? args)
{
Expand Down
22 changes: 11 additions & 11 deletions Signum.Engine/Schema/EntityEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@ namespace Signum.Engine.Maps
public class EntityEvents<T> : IEntityEvents
where T : Entity
{
public event PreSavingEventHandler<T> PreSaving;
public event SavingEventHandler<T> Saving;
public event SavedEventHandler<T> Saved;
public event PreSavingEventHandler<T>? PreSaving;
public event SavingEventHandler<T>? Saving;
public event SavedEventHandler<T>? Saved;

public event AlternativeRetriveEventHandler<T> AlternativeRetrive;
public event RetrievedEventHandler<T> Retrieved;
public event AlternativeRetriveEventHandler<T>? AlternativeRetrive;
public event RetrievedEventHandler<T>? Retrieved;

public CacheControllerBase<T>? CacheController { get; set; }

public event FilterQueryEventHandler<T> FilterQuery;
public event FilterQueryEventHandler<T>? FilterQuery;

public event PreUnsafeDeleteHandler<T> PreUnsafeDelete;
public event PreUnsafeMListDeleteHandler<T> PreUnsafeMListDelete;
public event PreUnsafeDeleteHandler<T>? PreUnsafeDelete;
public event PreUnsafeMListDeleteHandler<T>? PreUnsafeMListDelete;

public event PreUnsafeUpdateHandler<T> PreUnsafeUpdate;
public event PreUnsafeUpdateHandler<T>? PreUnsafeUpdate;

public event PreUnsafeInsertHandler<T> PreUnsafeInsert;
public event BulkInsetHandler<T> PreBulkInsert;
public event PreUnsafeInsertHandler<T>? PreUnsafeInsert;
public event BulkInsetHandler<T>? PreBulkInsert;

public Dictionary<PropertyRoute, IAdditionalBinding>? AdditionalBindings { get; private set; }

Expand Down
8 changes: 4 additions & 4 deletions Signum.Engine/Schema/ObjectName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public override int GetHashCode()

public static ServerName? Parse(string? name)
{
if (string.IsNullOrEmpty(name))
if (!name.HasText())
return null;

return new ServerName(name.UnScapeSql());
Expand Down Expand Up @@ -103,7 +103,7 @@ public override int GetHashCode()

public static DatabaseName? Parse(string? name)
{
if (string.IsNullOrEmpty(name))
if (!name.HasText())
return null;

var tuple = ObjectName.SplitLast(name);
Expand Down Expand Up @@ -174,7 +174,7 @@ public override int GetHashCode()

public static SchemaName Parse(string? name)
{
if (string.IsNullOrEmpty(name))
if (!name.HasText())
return SchemaName.Default;

var tuple = ObjectName.SplitLast(name);
Expand Down Expand Up @@ -220,7 +220,7 @@ public override int GetHashCode()

public static ObjectName Parse(string? name)
{
if (string.IsNullOrEmpty(name))
if (!name.HasText())
throw new ArgumentNullException(nameof(name));

var tuple = SplitLast(name);
Expand Down
4 changes: 2 additions & 2 deletions Signum.Engine/Schema/Schema.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public Version Version
set { this.version = value; }
}

public event Action OnMetadataInvalidated;
public event Action? OnMetadataInvalidated;
public void InvalidateMetadata()
{
this.OnMetadataInvalidated?.Invoke();
Expand Down Expand Up @@ -66,7 +66,7 @@ public Dictionary<Type, Table> Tables

#region Events

public event Func<Type, bool, string?> IsAllowedCallback;
public event Func<Type, bool, string?>? IsAllowedCallback;

public string? IsAllowed(Type type, bool inUserInterface)
{
Expand Down
2 changes: 1 addition & 1 deletion Signum.Engine/Schema/UniqueIndex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public string? ViewName
{
get
{
if (string.IsNullOrEmpty(Where))
if (!Where.HasText())
return null;

if (Connector.Current.AllowsIndexWithWhere(Where))
Expand Down
4 changes: 2 additions & 2 deletions Signum.Entities/Basics/IUserEntity.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Signum.Utilities;
using Signum.Utilities;
using System;

namespace Signum.Entities.Basics
Expand All @@ -10,7 +10,7 @@ public interface IUserEntity : IEntity
public static class UserHolder
{
public static readonly string UserSessionKey = "user";
public static event Action CurrentUserChanged;
public static event Action? CurrentUserChanged;

public static readonly SessionVariable<IUserEntity> CurrentUserVariable = Statics.SessionVariable<IUserEntity>(UserSessionKey);
public static IUserEntity Current
Expand Down
2 changes: 1 addition & 1 deletion Signum.Entities/DynamicQuery/ResultTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,6 @@ public T GetValue<T>(ResultColumn column)
return result;
}

public event PropertyChangedEventHandler PropertyChanged;
public event PropertyChangedEventHandler? PropertyChanged;
}
}
2 changes: 1 addition & 1 deletion Signum.Entities/DynamicQuery/Tokens/ExtensionToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected override List<QueryToken> SubTokensOverride(SubTokensOptions options)
return base.SubTokensBase(type, options, implementations);
}

public static Func<Type, string, Expression, Expression> BuildExtension;
public static Func<Type, string, Expression, Expression>? BuildExtension;

protected override Expression BuildExpressionInternal(BuildExpressionContext context)
{
Expand Down
Loading

0 comments on commit 3c0bf87

Please sign in to comment.