public interface ICrudService<T> where T: Entity, new()
What is the meaning of "new()
" at the end of the above code?
new()
means that T
has to have a parameterless constructor.
This is a help to enable you to construct objects of type T
in your generic class/method:
public T Create()
{
return new T();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With