Hi
I've been looking at NetTiers and came across this line:
public static Entity LocateOrCreate<Entity>(string key, string
typeString, Type entityFactoryType) where Entity : class, IEntity,
new()
Just wondered if anyone could point me towards some good documentation
on generics?
Thanks
Sam 4 1247
Juval has done a whole series of articles and tutorials. Try this google
search: http://www.google.com/search?hl=en&q...wy%22+generics
Peter
--
Co-founder, Eggheadcafe.com developer portal: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
"samuelhon" wrote:
Hi
I've been looking at NetTiers and came across this line:
public static Entity LocateOrCreate<Entity>(string key, string
typeString, Type entityFactoryType) where Entity : class, IEntity,
new()
Just wondered if anyone could point me towards some good documentation
on generics?
Thanks
Sam
samuelhon wrote:
Hi
I've been looking at NetTiers and came across this line:
public static Entity LocateOrCreate<Entity>(string key, string
typeString, Type entityFactoryType) where Entity : class, IEntity,
new()
Just wondered if anyone could point me towards some good documentation
on generics?
Thanks
Sam
For your example, the Entity is a generic type, and it has three
constraints:
1It has to be a class.
2It has to implement IEntity
3The new constraint, which specifies that any type argument in a
generic class declaration must have a public parameterless constructor.
Check out the C# specification here: http://msdn2.microsoft.com/en-us/net.../aa497266.aspx
chanmm
"samuelhon" <sa****@gmail.comwrote in message
news:11*********************@e3g2000cwe.googlegrou ps.com...
Hi
I've been looking at NetTiers and came across this line:
public static Entity LocateOrCreate<Entity>(string key, string
typeString, Type entityFactoryType) where Entity : class, IEntity,
new()
Just wondered if anyone could point me towards some good documentation
on generics?
Thanks
Sam
Cheers Peter, just the ticket
Peter wrote:
Juval has done a whole series of articles and tutorials. Try this google
search:
http://www.google.com/search?hl=en&q...wy%22+generics
Peter
--
Co-founder, Eggheadcafe.com developer portal: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
"samuelhon" wrote:
Hi
I've been looking at NetTiers and came across this line:
public static Entity LocateOrCreate<Entity>(string key, string
typeString, Type entityFactoryType) where Entity : class, IEntity,
new()
Just wondered if anyone could point me towards some good documentation
on generics?
Thanks
Sam This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: andrew queisser |
last post by:
I've read some material on the upcoming Generics for C#. I've
seen two types of syntax used for constraints:
- direct specification of the interface in the angle brackets
- where clauses
I...
|
by: Dietmar Kuehl |
last post by:
Hi,
after reading the documentation on C# generics from several sources, I'm
still unclear whether it is possible to infer associated types from a
type argument. For example, if I have an...
|
by: Thomas Tomiczek |
last post by:
Ok, working my way through a complex library conversion to .NET 2.0 and C#
2.0 with generics I am totally stuck on one thing -if anyone sees the issue
I would be more than glad.
The situation is...
|
by: Locia |
last post by:
Hi,
I have two question.
How c# implement generics?I need to explanation or a link.
Polymorphic method can be virtual?
Thanks in advance
|
by: Michael S |
last post by:
Why do people spend so much time writing complex generic types?
for fun?
to learn?
for use?
I think of generics like I do about operator overloading.
Great to have as a language-feature, as...
|
by: sloan |
last post by:
I'm not the sharpest knife in the drawer, but not a dummy either.
I'm looking for a good book which goes over Generics in great detail.
and to have as a reference book on my shelf.
Personal...
|
by: riftimes |
last post by:
Hello,
would you help me to find totorials with examples about generics and
Dictionary
thank you.
|
by: Gary Brown |
last post by:
Hi,
When I do the following
public class IAmAGeneric<T>
{
...
public T AMember (T a, T b) { return a + b; };
}
|
by: JCauble |
last post by:
I have a question about using Generics with Interfaces and some of there
inheritance issues / problems. If this is not possible what I describe below
I will have to go a different route and would...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |