Massive.DynamicModel.BuildCommands C# (CSharp) Method

BuildCommands() public method

Builds a set of Insert and Update commands based on the passed-on objects. These objects can be POCOs, Anonymous, NameValueCollections, or Expandos. Objects With a PK property (whatever PrimaryKeyField is set to) will be created at UPDATEs
public BuildCommands ( ) : List
return List
        public virtual List<DbCommand> BuildCommands(params object[] things)
        {
            var commands = new List<DbCommand>();
            foreach (var item in things) {
                if (HasPrimaryKey(item)) {
                    commands.Add(CreateUpdateCommand(item, GetPrimaryKey(item)));
                }
                else {
                    commands.Add(CreateInsertCommand(item));
                }
            }
            return commands;
        }