自动发布调整测试
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
7caabad651
commit
132f90b28e
|
@ -173,61 +173,58 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
|
||||
#region history 使用扩展删除包,同时自动赋值更新人 更新时间
|
||||
|
||||
var bindings = ((MemberInitExpression)updateFactory.Body).Bindings.ToList();
|
||||
//var bindings = ((MemberInitExpression)updateFactory.Body).Bindings.ToList();
|
||||
|
||||
var hasPropNameList = bindings.Select(t => t.Member.Name).ToList();
|
||||
//var hasPropNameList = bindings.Select(t => t.Member.Name).ToList();
|
||||
|
||||
|
||||
if (typeof(IAuditUpdate).IsAssignableFrom(typeof(T)))
|
||||
{
|
||||
//if (typeof(IAuditUpdate).IsAssignableFrom(typeof(T)))
|
||||
//{
|
||||
|
||||
if (!hasPropNameList.Contains(nameof(IAuditUpdate.UpdateTime)))
|
||||
{
|
||||
bindings.Add(Expression.Bind(typeof(T).GetMember(nameof(IAuditUpdate.UpdateTime))[0], Expression.Constant(DateTime.Now)));
|
||||
// if (!hasPropNameList.Contains(nameof(IAuditUpdate.UpdateTime)))
|
||||
// {
|
||||
// bindings.Add(Expression.Bind(typeof(T).GetMember(nameof(IAuditUpdate.UpdateTime))[0], Expression.Constant(DateTime.Now)));
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
if (!hasPropNameList.Contains(nameof(IAuditUpdate.UpdateUserId)))
|
||||
{
|
||||
bindings.Add(Expression.Bind(typeof(T).GetMember(nameof(IAuditUpdate.UpdateUserId))[0], Expression.Constant(updateUserId)));
|
||||
// if (!hasPropNameList.Contains(nameof(IAuditUpdate.UpdateUserId)))
|
||||
// {
|
||||
// bindings.Add(Expression.Bind(typeof(T).GetMember(nameof(IAuditUpdate.UpdateUserId))[0], Expression.Constant(updateUserId)));
|
||||
|
||||
}
|
||||
}
|
||||
// }
|
||||
//}
|
||||
|
||||
//var member = Expression.MemberInit(Expression.New(typeof(T)), bindings);
|
||||
|
||||
var member = Expression.MemberInit(Expression.New(typeof(T)), bindings);
|
||||
//var factory = Expression.Lambda<Func<T, T>>(member, Expression.Parameter(typeof(T), "x"));
|
||||
|
||||
var factory = Expression.Lambda<Func<T, T>>(member, Expression.Parameter(typeof(T), "x"));
|
||||
|
||||
|
||||
|
||||
return await _dbContext.Set<T>().IgnoreQueryFilters().Where(where).BatchUpdateAsync(factory).ConfigureAwait(false) > 0;
|
||||
//return await _dbContext.Set<T>().IgnoreQueryFilters().Where(where).BatchUpdateAsync(factory).ConfigureAwait(false) > 0;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region efcore 7 & 8
|
||||
//{
|
||||
// var fieldValues = updateFactory.ExtractFieldValues();
|
||||
{
|
||||
var fieldValues = updateFactory.ExtractFieldValues();
|
||||
|
||||
// var hasPropNameList = ((MemberInitExpression)updateFactory.Body).Bindings.Select(t => t.Member.Name).ToList();
|
||||
var hasPropNameList = ((MemberInitExpression)updateFactory.Body).Bindings.Select(t => t.Member.Name).ToList();
|
||||
|
||||
// if (typeof(IAuditUpdate).IsAssignableFrom(typeof(T)))
|
||||
// {
|
||||
if (typeof(IAuditUpdate).IsAssignableFrom(typeof(T)))
|
||||
{
|
||||
|
||||
// if (!hasPropNameList.Contains(nameof(IAuditUpdate.UpdateTime)))
|
||||
// {
|
||||
// fieldValues.Add(nameof(IAuditUpdate.UpdateTime), DateTime.Now);
|
||||
// }
|
||||
if (!hasPropNameList.Contains(nameof(IAuditUpdate.UpdateTime)))
|
||||
{
|
||||
fieldValues.Add(nameof(IAuditUpdate.UpdateTime), DateTime.Now);
|
||||
}
|
||||
|
||||
// if (!hasPropNameList.Contains(nameof(IAuditUpdate.UpdateUserId)))
|
||||
// {
|
||||
// fieldValues.Add(nameof(IAuditUpdate.UpdateUserId), updateUserId);
|
||||
// }
|
||||
// }
|
||||
if (!hasPropNameList.Contains(nameof(IAuditUpdate.UpdateUserId)))
|
||||
{
|
||||
fieldValues.Add(nameof(IAuditUpdate.UpdateUserId), updateUserId);
|
||||
}
|
||||
}
|
||||
|
||||
// return await _dbContext.Set<T>().IgnoreQueryFilters().Where(where).ExecuteUpdateAsync(fieldValues).ConfigureAwait(false) > 0;
|
||||
//}
|
||||
return await _dbContext.Set<T>().IgnoreQueryFilters().Where(where).ExecuteUpdateAsync(fieldValues).ConfigureAwait(false) > 0;
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -80,7 +80,7 @@ trigger:
|
|||
---
|
||||
kind: pipeline
|
||||
type: ssh
|
||||
name: default
|
||||
name: ssh-linux-test-irc-publish
|
||||
|
||||
platform:
|
||||
os: Linux
|
||||
|
@ -90,18 +90,17 @@ clone:
|
|||
disable: true #禁用默认克隆
|
||||
|
||||
server:
|
||||
host: 101.132.193.237
|
||||
host: 123.56.94.154
|
||||
user: root
|
||||
password:
|
||||
from_secret: uat_ssh_pwd
|
||||
from_secret: test_ssh_pwd
|
||||
|
||||
steps:
|
||||
- name: greeting
|
||||
- name: publish-test-irc
|
||||
commands:
|
||||
- echo start publish test-irc-api
|
||||
- cd /opt/hang/cicd/test_irc
|
||||
- echo sh test-irc.sh v${DRONE_BUILD_NUMBER}
|
||||
- sh test-irc.sh
|
||||
- cd /opt/1panel/hang/devops/test-irc
|
||||
- sh test-irc.sh v${DRONE_BUILD_NUMBER}
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
|
@ -112,28 +111,27 @@ trigger:
|
|||
|
||||
kind: pipeline
|
||||
type: ssh
|
||||
name: ssh-windows-test-study-publish
|
||||
name: ssh-linux-test-study-publish
|
||||
|
||||
platform:
|
||||
os: windows
|
||||
arch: amd64
|
||||
os: Linux
|
||||
arch: 386
|
||||
|
||||
clone:
|
||||
disable: true #禁用默认克隆
|
||||
|
||||
server:
|
||||
host: 123.56.94.154
|
||||
user: Administrator
|
||||
password: WHxckj2019
|
||||
user: root
|
||||
password:
|
||||
from_secret: test_ssh_pwd
|
||||
|
||||
steps:
|
||||
- name: publish-test-study
|
||||
- name: publish-test-study
|
||||
commands:
|
||||
- Start-Process "C:\CICD\Test.Study\netcore_Publish.bat" -Wait
|
||||
- cd C:\CICD\Test.Study\netcore_repo
|
||||
- dotnet restore .\IRaCIS.Core.API\IRaCIS.Core.API.csproj --packages C:\Users\Administrator\.nuget\packages
|
||||
- dotnet publish .\IRaCIS.Core.API\IRaCIS.Core.API.csproj -c Release --no-restore --packages C:\Users\Administrator\.nuget\packages -o D:\Develop\Test_Study_PublishSite\IRaCIS.NetCore.API
|
||||
- Start-Service -Name "Test_Study_API"
|
||||
- echo start publish test-study-api
|
||||
- cd /opt/1panel/hang/devops/test-study
|
||||
- sh test-study.sh v${DRONE_BUILD_NUMBER}
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
|
|
Loading…
Reference in New Issue