UpdateStrategy for Actions was added

This commit is contained in:
Evgeny Redikultsev
2023-07-09 19:46:36 +05:00
parent 03b882f54d
commit 3e0e51d0c9
30 changed files with 402 additions and 138 deletions

View File

@@ -0,0 +1,17 @@
using StructureHelperCommon.Models.Forces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperCommon.Infrastructures.Exceptions
{
public static class ErrorCommonProcessor
{
public static void ObjectTypeIsUnknown(Type expectedType, Type actualType)
{
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknown + $"\n Expected: {expectedType},\n But was: {actualType}");
}
}
}

View File

@@ -6,8 +6,17 @@ using System.Threading.Tasks;
namespace StructureHelperCommon.Infrastructures.Interfaces
{
/// <summary>
/// Logic for update object of type <typeparamref name="T"/>
/// </summary>
/// <typeparam name="T">Type of object</typeparam>
public interface IUpdateStrategy<T>
{
/// <summary>
/// Update properties of target object from source object
/// </summary>
/// <param name="targetObject">Target object</param>
/// <param name="sourceObject">Source object</param>
void Update(T targetObject, T sourceObject);
}
}