public Task <int> Save(OrganizeEntity organizeEntity, string keyValue, HttpContext context) { if (!string.IsNullOrEmpty(keyValue)) { organizeEntity.AttachModifyInfo(keyValue, context); return(service.UpdateAsync(organizeEntity)); } else { organizeEntity.AttachCreateInfo(context); return(service.InsertAsync(organizeEntity)); } }
public Task <int> Save(OrganizeEntity organizeEntity, string keyValue, string userId) { if (!string.IsNullOrEmpty(keyValue)) { organizeEntity.AttachModifyInfo(keyValue, userId); return(repo.UpdateAsync(organizeEntity)); } else { organizeEntity.AttachCreateInfo(userId); return(repo.InsertAsync(organizeEntity)); } }