init
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
using System.Reflection;
|
||||
using Kreta.BusinessLogic.Classes.MobileApi.Naplo.V2.Converter;
|
||||
|
||||
namespace Kreta.BusinessLogic.Classes.MobileApi.Naplo.V2.Logic
|
||||
{
|
||||
public static class HashLogic
|
||||
{
|
||||
private static string GetNonce() => Assembly.GetExecutingAssembly().GetName().Version.ToString().Replace(".", "_");
|
||||
public static string CreateSourceHash<T>(T responseCO) where T : class, new()
|
||||
=> (responseCO != null) ? CustomJsonConverter.SerializeObjectToJson(responseCO)?.GetHashCode().ToString() + "__" + GetNonce() : null;
|
||||
|
||||
//public static string CreateResponseHash<T>(T responseCO, string requestHash) where T : class, IGetResponseCo, new()
|
||||
// => (responseCO != null && !responseCO.Hash.Equals(requestHash)) ? responseCO.Hash : null;
|
||||
//public static T CreateResponseData<T>(T responseCO, string requestHash) where T : class, IGetResponseCo, new()
|
||||
// => (responseCO != null && !responseCO.Hash.Equals(requestHash)) ? responseCO : null;
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user