This is a generic abstract class of type
TModel
and this class inherits from
XPart
.
Since this class is marked as
abstract
you cannot create an instance of it, but you can create an object for it.
There are also two fields with
protected
access modifier which instructs that these fields can be only used in this class and the classes inheriting from this class.
XPartOutParam
is the attribute applied to the property current page. and
the second property is an object from the type
TModel
.
Eg if i derive a class from the above mentioned then
public class InheritAbstract : EditXPart<Product>
{
}
the property
TModel
becomes Product
_enity
is the object of product
ie.,
TModel = Product , _entity = objProduct (Product objProduct)
if
TModel
is Order then
_entity = objOrder(Order objOrder)
and so on. Hence the Type TModel is defined in compile time.
Regarding the
Attribute
it is a custom attribute created for some paging purposes I guess. Since the attribute takes the parameter name same as the property name, probably your
Attribute
code will be using System.Reflection to implement some common paging logic.
And as i mentioned earlier since this is an abstract class you cant create an instance i.e.
EditXPart<Product> objProduct = new EditXPart<Product>();
is not possible but.
EditXPart<Product> objProduct
is possible. So what is the use in case of our example you can create
EditXPart<Product> objProduct =new InheritAbstract();
i.e. fill an instance of derived class in the object of your Generic one.