I'm developing own extension for Inriver framework.
My iniver.cproj file:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>library</OutputType>
<TargetFramework>net4.7.2</TargetFramework>
<RootNamespace>MyInriver</RootNamespace>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="inRiver.Remoting.iPMC" Version="8.2.4" />
</ItemGroup>
</Project>
I add this file also here: https://pastebin.com/h7BqHM9W
My Program.cs file:
using inRiver.Remoting.Extension.Interface;
using System.Collections.Generic;
using System.Linq;
using inRiver.Remoting.Extension;
using inRiver.Remoting.Objects;
using inRiver.Remoting.Log;
namespace MyInriver
{
public class MyEntityListener : IEntityListener
{
/* In the inRiverContext you will find the authenticated Remoting API, settings, logging, etc...*/
public inRiverContextContext { get; set; }
/* Define your default settings for the Extension here, <key> , <defaultValue> */
public Dictionary<string, string> DefaultSettings=>newDictionary<string, string>();
/* Initialize variables */
public string fieldsToIgnoreString=string.Empty;
public string[] fieldsToIgnoreArray=newstring[0];
public voidEntityUpdated(intentityId, string[] fields)
{
/* Retrieve inputted values for Fields_To_Ignore setting */
fieldsToIgnoreString = Context.Settings["FIELDS_TO_IGNORE"];
/* Check to see if the Fields_To_Ignore extension setting is used */
if (string.IsNullOrEmpty(fieldsToIgnoreString))
{
/* Fields_To_Ignore is not used, no field update events will be ignored
* Insert Logic Here */
}
else
{
/* Store the ignored fields into an array so they can be compared with the updated fields */
string[] fieldsToIgnoreArray=fieldsToIgnoreString.Split(',').Select(sValue=>sValue.Trim()).ToArray();
/* Check to see if the changes on the updated fields are ignored or accepted. */
foreach (stringfieldinfields)
{
if (fieldsToIgnoreArray.Contains(field))
{
/* Ignore, Skip, Do Nothing, ect...
* Insert Logic Here */
Context.Log(LogLevel.Information, $"The field update for "+field+" on entity with id "+entityId+" was ignored.");
}
else
{
/* Make Another Update, Send Update, Take Action, ect...
* Insert Logic Here */
Context.Log(LogLevel.Information, $"The field update for "+field+" on entity with id "+entityId+" was accepted.");
}
}
}
}
public void EntityCommentAdded(intentityId, intcommentId) { }
public void EntityCreated(intentityId) { }
public void EntityDeleted(EntitydeletedEntity) { }
public void EntityFieldSetUpdated(intentityId, stringfieldSetId) { }
public void EntityLocked(intentityId) { }
public void EntitySpecificationFieldAdded(intentityId, stringfieldName) { }
public void EntitySpecificationFieldUpdated(intentityId, stringfieldName) { }
public void EntityUnlocked(intentityId) { }
public string Test()
{
return"Test string";
}
}
}
I add this file also here: https://pastebin.com/GDqJ1gNm
Next, I compile this, add to zip and upload as inriver package.
But when I add extension, and trying to trigger test method, I get error: "Unable to find extension to test"
And in Log I see this:
- "An error occurred when creating instance for extension Myiniver"
What I do wrong?
Extension params: