public abstract class GenericRepository<C, T> : IGenericRepository<T> where T : class where C : DbContext, new()
public virtual void ExecuteSQLCommand(string consulta)
{
_entities.Database.ExecuteSqlCommand(consulta);
}
{
void ExecuteSQLCommand(string consulta);
}
and I have a Business Class with the method(Another proy, same solution)
public bool SQlComand(string Query, params string[] Parametros)
{
try
{
string strSqlQuery = string.Format(Query, Parametros);
unitOfWork.TablasTipo.ExecuteSQLCommand(strSqlQuery);
return true;
}
catch(Exception ex)
{
return false;
}
}
and in my code
string[] Parametros = new string[6];
Parametros[0] = "";
Parametros[1] = "'";
Parametros[2] = "'" ;
Parametros[3] = "";
Parametros[4] = "'";
Parametros[5] = "";
if (tablas.SQlComand("Insert into {0} Values({1},{2},{3},{4},{5})", Parametros)==true)
{
litMensaje.Text = WebFormUtilities.GenerarMensajeAlerta(WebFormUtilities.TipoAlertaMensaje.Success, "OK");
}
How to build a method in each proy and how in the last, I can receive the data????????????????
please help....