public async Task <MvEvent> InsertUpdateEvent(MvEvent mvEvent) { if (mvEvent.EventId == 0) { var dp = new DynamicParameters(); dp.Add("@Json", JsonConvert.SerializeObject(mvEvent), direction: ParameterDirection.InputOutput); await das.ActionProcedure("SpEventIns", dp); string newEvent = dp.Get <string>("@Json"); return(JsonConvert.DeserializeObject <MvEvent>(newEvent)); } else { var dp = new DynamicParameters(); dp.Add("@Json", JsonConvert.SerializeObject(mvEvent), direction: ParameterDirection.Input); await das.ActionProcedure("SpEventUpd", dp); string newEvent = dp.Get <string>("@Json"); return(JsonConvert.DeserializeObject <MvEvent>(newEvent)); } }