using Connected.Notifications; namespace Connected.Interop; public static class InteropExtensions { public static TArgs AsArguments(this IDto args) where TArgs : IDto { var instance = typeof(TArgs).CreateInstance(); return Serializer.Merge(instance, args); } public static TArgs AsArguments(this IDto args, params object[] sources) where TArgs : IDto { var instance = typeof(TArgs).CreateInstance(); return Serializer.Merge(instance, sources.ToArray(), args); } public static TArgs AsEventArguments(this IDto args) where TArgs : IEventArgs { var instance = typeof(TArgs).CreateInstance(); return Serializer.Merge(instance, args); } }