Before update to NET 7
This commit is contained in:
@@ -179,7 +179,7 @@ public class IDIS_DBContext:DbContext
|
||||
Handle = handle
|
||||
};
|
||||
Values.Add(value);
|
||||
SaveChanges();
|
||||
SaveChangesAsync();
|
||||
return true;
|
||||
}
|
||||
public void Register(string handle,string format, string value,string category)
|
||||
@@ -197,7 +197,7 @@ public class IDIS_DBContext:DbContext
|
||||
Category = category,
|
||||
};
|
||||
Datas.Add(data);
|
||||
SaveChanges();
|
||||
SaveChangesAsync();
|
||||
}
|
||||
|
||||
public void RegisterReference(string handle, string refenceHandle)
|
||||
@@ -207,19 +207,17 @@ public class IDIS_DBContext:DbContext
|
||||
Handle = handle,
|
||||
RelatedHandle = refenceHandle,
|
||||
});
|
||||
SaveChanges();
|
||||
SaveChangesAsync();
|
||||
}
|
||||
|
||||
public bool Update(string handle, string format, string value)
|
||||
{
|
||||
var result = Datas.FirstOrDefault(x => x.Handle == handle && x.Format == format);
|
||||
if (result is not null)
|
||||
{
|
||||
result.UpdateTime=DateTime.Now;
|
||||
result.Value = value;
|
||||
SaveChanges();
|
||||
}
|
||||
return result is not null;
|
||||
if (result is null) return false;
|
||||
result.UpdateTime=DateTime.Now;
|
||||
result.Value = value;
|
||||
SaveChangesAsync();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// ReSharper disable once IdentifierTypo
|
||||
|
Reference in New Issue
Block a user