473,396 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Generics documentation

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

Oct 26 '06 #1
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

Oct 26 '06 #2
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.
Oct 26 '06 #3
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

Oct 26 '06 #4
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
Nov 3 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
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...
4
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...
6
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...
1
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
12
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...
9
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...
18
by: riftimes | last post by:
Hello, would you help me to find totorials with examples about generics and Dictionary thank you.
8
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; }; }
7
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
0
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
0
BarryA
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...
0
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...
0
marktang
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,...
0
Oralloy
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,...
0
jinu1996
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...
0
tracyyun
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.