Commit eb3d9e6f authored by yangxiaodong's avatar yangxiaodong

refactor code

parent 313b7844
......@@ -6,6 +6,9 @@ namespace Cap.Consistency.EntityFrameworkCore
{
public ConsistencyMessage() {
Id = Guid.NewGuid().ToString();
SendTime = DateTime.Now;
UpdateTime = SendTime;
Status = MessageStatus.WaitForSend;
}
}
......
......@@ -75,7 +75,7 @@ namespace Cap.Consistency
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="OperateResult"/>
/// of the operation.
/// </returns>
public virtual Task<OperateResult> UpdateMessageAsync(TMessage message) {
public virtual Task<OperateResult> UpdateAsync(TMessage message) {
ThrowIfDisposed();
//todo: validation message fileds is correct
......@@ -90,7 +90,7 @@ namespace Cap.Consistency
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="OperateResult"/>
/// of the operation.
/// </returns>
public virtual Task<OperateResult> DeleteMessageAsync(TMessage message) {
public virtual Task<OperateResult> DeleteAsync(TMessage message) {
ThrowIfDisposed();
if (message == null) {
......
using System;
using Microsoft.EntityFrameworkCore.Internal;
namespace Cap.Consistency.EntityFrameworkCore.Test.Utilities
namespace Cap.Consistency.EntityFrameworkCore.Test
{
public class ScratchDatabaseFixture : IDisposable
{
......
......@@ -68,7 +68,7 @@ namespace Cap.Consistency.Test
Assert.True(operateResult.Succeeded);
var messageId = await manager.GetMessageIdAsync(message);
operateResult = await manager.DeleteMessageAsync(message);
operateResult = await manager.DeleteAsync(message);
Assert.Null(await manager.FindByIdAsync(messageId));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment