Class ModelPagedListResult<TModel>
Concrete class that implements the interface with the necessary methods to execute the validations of the model paginated collection.
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ToString()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: StoneCo.Framework.Model.ModelRules
Assembly: cs.temp.dll.dll
Syntax
public class ModelPagedListResult<TModel> : ModelResult, IModelPagedListResult<TModel>, IModelResult where TModel : IModel
Type Parameters
Name | Description |
---|---|
TModel | The type of the model to be returned in the result. |
Constructors
ModelPagedListResult()
Default constructor that set ModelStatusCode 200 and Message Success.
Declaration
public ModelPagedListResult()
ModelPagedListResult(Guid)
Default constructor that set ModelStatusCode 200, Message Success and TraceKey.
Declaration
public ModelPagedListResult(Guid traceKey)
Parameters
Type | Name | Description |
---|---|---|
Guid | traceKey | Key of trace. |
Properties
PagedListModels
Paginated collection model of the type TModel.
Declaration
public PagedList<TModel> PagedListModels { get; }
Property Value
Type | Description |
---|---|
PagedList<TModel> | Paginated collection of the model or null. |
Methods
SetModel(PagedList<TModel>)
Set paginated collection models of the type TModel.
Declaration
public void SetModel(PagedList<TModel> pagedListModels)
Parameters
Type | Name | Description |
---|---|---|
PagedList<TModel> | pagedListModels | Paginated collection of the model. |
Examples
Sample using Foo class.
private static IModelPagedListResult<Foo> Validate(Foo foo)
{
var result = new IModelPagedListResult<Foo>();
var fooList = new IModelPagedListResult<Foo> { foo };
var fooPagedList = new PagedList(fooList, 1, 1, 1, true);
result.SetModel(fooPagedList);
return result;
}