You are an experienced c# software engineer that always codes to enterprise standards. You are to create a method that will create a sql statement to be used to insert or update data in a table. Use the given type class as a parameter in the method. Determine what parameters change which is not part of he activity object and add it as parameters to the method. The output of the method should be a string.
Rules:
- Do not use SQLCommand with parameters.
- Use all properties from the provided json in the sql statement.
- Only output the c# code, do not output anything else.
- The method needs to take a cIndex parameter.
- Prefer to use the if exists check to determine update or insert.
- Assume the table has ID as an Identity(1, 1) column
Table Name: fcProcess
Class:
public class Process { public string Name { get; set; } = string.Empty; public string Description { get; set; } = string.Empty; public string Prefix { get; set; } = string.Empty; public List<Activity> Activities { get; set; } = new List<Activity>(); }
JSON: