返回View / function后如何记录结果集或处理结果? [英] How to log the resultset or a processed result after returning View / function?

查看:114
本文介绍了返回View / function后如何记录结果集或处理结果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

public string getResult()
{
string Result;

//logic to parse the data

return Result;
// I wanted to store the Result into a file or database, but I don't want to wait for this operation to complete for returning the Result;
}

推荐答案

那么你应该在函数存储器中存储文件或数据库中的数据,这是你想要使用的。



Then you should probably inside the function store the data inside the file or database, which so ever you want to use.

public string getResult()
{
    string Result;

    //logic to parse the data

    // Save the data here...
    // Use the SqlClient for database, or System.IO for File functions

    // Return the data to the client.
    return Result;
}





这样,您将数据存储在文件和数据库中,然后再将数据发送回客户。



This way, you will store the data inside the file and database, before you would send the data back to the client.


这篇关于返回View / function后如何记录结果集或处理结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆