Beispiel #1
0
 public int Create(AppsVM dataVM)
 {
     using (SqlConnection connection = new SqlConnection(_configuration.GetConnectionString("myConnection")))
     {
         var procName = "SP_Create_Apps";
         parameters.Add("name", dataVM.Name);
         parameters.Add("insDate", DateTimeOffset.Now);
         var insert = connection.Execute(procName, parameters, commandType: CommandType.StoredProcedure);
         return(insert);
     }
 }
Beispiel #2
0
 public int Update(AppsVM dataVM, int id)
 {
     using (SqlConnection connection = new SqlConnection(_configuration.GetConnectionString("myConnection")))
     {
         var procName = "SP_Update_Apps";
         parameters.Add("Id", id);
         parameters.Add("name", dataVM.Name);
         parameters.Add("updDate", DateTimeOffset.Now);
         var Edit = connection.Execute(procName, parameters, commandType: CommandType.StoredProcedure);
         return(Edit);
     }
 }