本文整理汇总了C#中LoveBank.Core.MSData.LoveBankDBContext.AddAsync方法的典型用法代码示例。如果您正苦于以下问题:C# LoveBankDBContext.AddAsync方法的具体用法?C# LoveBankDBContext.AddAsync怎么用?C# LoveBankDBContext.AddAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LoveBank.Core.MSData.LoveBankDBContext
的用法示例。
在下文中一共展示了LoveBankDBContext.AddAsync方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: App_MachineHeartbeat
/// <summary>
/// 心跳检查一体机运行状况
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
public ActionResult App_MachineHeartbeat(MachineHeartbeat entity)
{
entity.AddTime = DateTime.Now;
JsonMessage retJson = new JsonMessage();
using (LoveBankDBContext db = new LoveBankDBContext())
{
db.AddAsync<MachineHeartbeat>(entity);
db.SaveChangesAsync();
retJson.Status = true;
return Json(retJson);
}
}
示例2: App_MachineStatistics
/// <summary>
/// 统计首页各个模块点击情况
/// ModuleCode:模块自定义编码
/// ModuleId:模块Id
/// MachineCode:机器唯一编码
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
public ActionResult App_MachineStatistics(MachineStatistics entity)
{
entity.AddTime = DateTime.Now;
JsonMessage retJson = new JsonMessage();
using (LoveBankDBContext db = new LoveBankDBContext())
{
var tm = db.T_Machine;
Machine mModel = tm.FirstOrDefault(x => x.MachineCode == entity.MachineCode);
if (mModel != null)
{
entity.DeptId = mModel.DeptId;
//entity.ModuleId = mModel.ID;
}
db.AddAsync<MachineStatistics>(entity);
db.SaveChangesAsync();
retJson.Status = true;
return Json(retJson);
}
}