Exemplo n.º 1
0
        public T Registrar(T entity)
        {
            entity.FechaCreacion = new DateTime();
            Dictionary <String, String> d = Reflection.ArmarParametrosDeCreacion(entity);

            String columns = d["columns"];
            string values  = d["values"];

            String query = "insert into " + GetTableName() + "(" + columns + ")" + " output INSERTED.ID values " + "(" + values + ");";

            entity.Id = helper.Create(query, null);

            return(BuscarPorId(entity.Id));
        }