Commit 209bdcff authored by yangxiaodong's avatar yangxiaodong

add modelbinder.

parent 03392c00
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
namespace Cap.Consistency.Abstractions.ModelBinding
{
public interface IModelBinder
{
Task BindModelAsync(ModelBindingContext bindingContext);
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Extensions.Primitives;
namespace Cap.Consistency.Abstractions.ModelBinding
{
public class ModelBindingContext
{
public object Model { get; set; }
public string ModelName { get; set; }
public Type ModelType { get; set; }
public StringValues Values { get; set; }
public object Result { get; set; }
public static ModelBindingContext CreateBindingContext(string values, string modelName, Type modelType) {
return new ModelBindingContext() {
ModelName = modelName,
ModelType = modelType,
Values = values
};
}
}
}
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