quinta-feira, 18 de junho de 2015

Using parameters with EntityFramework on Informix Select Statements

Using parameters with EntityFramework on Informix Select Statements
Usando parameters com EntityFrameWork em instruções Select no Informix


public class MyClass {
  public string PropertyA { get; set; }
  public string PropertyB { get; set; }
}


string sqlQuery = "SELECT columnA As PropertyA, columnB as PropertyB FROM tablename WHERE UPPER(columnC) LIKE UPPER(?);");
                    
List<object> parameters = new List<object>();
parameters.Add(string.Format("%{0}%"wordToLikeClausule));

var resultObjects = myDbContext.SqlQuery<MyClass>(sqlQuery, 
                             paramparametersetrosSql.ToArray()).ToList();