|
@@ -6,11 +6,11 @@ using XF.Domain.Authentications;
|
|
|
using XF.Domain.Entities;
|
|
|
using XF.Domain.Repository;
|
|
|
|
|
|
-namespace Hotline.Repository.SqlSugar.Extensions
|
|
|
+namespace Hotline.Repository.SqlSugar.Exam.Extensions
|
|
|
{
|
|
|
public static class ApiServiceExtension
|
|
|
{
|
|
|
- public static void ToInsert<T>(this T entity,ISessionContext sessionContext=null) where T : class, IEntity<string>, new()
|
|
|
+ public static void ToInsert<T>(this T entity, ISessionContext sessionContext = null) where T : class, IEntity<string>, new()
|
|
|
{
|
|
|
if (entity.Id.IsNullOrEmpty())
|
|
|
{
|
|
@@ -26,11 +26,11 @@ namespace Hotline.Repository.SqlSugar.Extensions
|
|
|
if (creationEntity != null)
|
|
|
{
|
|
|
creationEntity.CreationTime = DateTime.Now;
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(entity is ExamBusinessEntity)
|
|
|
+ if (entity is ExamBusinessEntity)
|
|
|
{
|
|
|
var creationEntity = entity as ExamBusinessEntity;
|
|
|
if (creationEntity != null)
|
|
@@ -52,13 +52,13 @@ namespace Hotline.Repository.SqlSugar.Extensions
|
|
|
current.CreatorName = sessionContext.UserName;
|
|
|
current.AreaId = sessionContext.AreaId;
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|
|
|
public static void ToInsert<T>(this List<T> entities, ISessionContext sessionContext = null) where T : class, IEntity<string>, new()
|
|
|
{
|
|
|
- foreach(var entity in entities)
|
|
|
+ foreach (var entity in entities)
|
|
|
{
|
|
|
entity.ToInsert(sessionContext);
|
|
|
}
|
|
@@ -66,14 +66,14 @@ namespace Hotline.Repository.SqlSugar.Extensions
|
|
|
|
|
|
public static void ToUpdate<T>(this T entity, ISessionContext sessionContext = null) where T : class, IEntity<string>, new()
|
|
|
{
|
|
|
- if(entity is FullStateEntity)
|
|
|
+ if (entity is FullStateEntity)
|
|
|
{
|
|
|
var fullStateEntity = entity as FullStateEntity;
|
|
|
if (fullStateEntity != null)
|
|
|
fullStateEntity.LastModificationTime = DateTime.Now;
|
|
|
|
|
|
- entity = fullStateEntity as T ?? entity;
|
|
|
-
|
|
|
+ entity = fullStateEntity as T ?? entity;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
if (sessionContext != null)
|
|
@@ -92,7 +92,7 @@ namespace Hotline.Repository.SqlSugar.Extensions
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static void ToUpdate<T>(this List<T> entities, ISessionContext sessionContext = null) where T : class, IEntity<string>, new()
|
|
|
+ public static void ToUpdate<T>(this List<T> entities, ISessionContext sessionContext = null) where T : class, IEntity<string>, new()
|
|
|
{
|
|
|
foreach (var entity in entities)
|
|
|
{
|