DocSpace-client/common/ASC.Api.Core/Core/Update.cs

20 lines
422 B
C#
Raw Normal View History

namespace ASC.Api.Utils;
public static class Update
2020-04-20 12:54:13 +00:00
{
public static T IfNotEquals<T>(T current, T @new)
2020-04-20 12:54:13 +00:00
{
if (!Equals(current, @new)) return @new;
return current;
}
2020-04-20 12:54:13 +00:00
public static T IfNotEmptyAndNotEquals<T>(T current, T @new)
{
if (Equals(@new, default(T))) return current;
2020-04-20 12:54:13 +00:00
if (!Equals(current, @new)) return @new;
return current;
2020-04-20 12:54:13 +00:00
}
}