Massive.DynamicModel.Save C# (CSharp) Method

Save() public method

Executes a set of objects as Insert or Update commands based on their property settings, within a transaction. 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 Save ( ) : int
return int
        public virtual int Save(params object[] things)
        {
            foreach (var item in things) {
                if (!IsValid(item)) {
                    throw new InvalidOperationException("Can't save this item: " + String.Join("; ", Errors.ToArray()));
                }
            }
            var commands = BuildCommands(things);
            return Execute(commands);
        }

Usage Example

        public static void CheckSolicitud(string solicitudId)
        {
            var tbl = new DynamicModel("diarco", tableName: "SolicitudEntrega", primaryKeyField: "id");

            var solicitud = new  {id = solicitudId, checks = 1};
            tbl.Save(solicitud);
        }