|
Hi guys I have a dependency that I need to inject into one of my classes. This dependency will be lifestyle of Transient. It inturn has a dependency of type Type. This type should be the type of the original class. I was just wondering if anyone has any...
Started by vdhant on
, 6 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
The other alternative is that....
Pass the instance into the register, that way you don't need to pass the type into the constructor I am trying to achieve, the Register needs to have the type of the parent class in order for it to do that.
|
|
I've a some type (object of Type ). Need to check that this type has interface IList.
How I can do this?
Started by Chernikov on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Type customListType = new YourCustomListType().GetType(); if (typeof(IList).IsAssignableFrom(customListType)) { //Will be true if "YourCustomListType : IList" }
Assuming you have an object type with the type System.Type (what I....
|
|
Hi guys, i'm a pl/sql newbie. now i have a question about oracle type . i saw there are two types of type :
CREATE OR REPLACE TYPE "TYPE_NAME1" AS OBJECT ( temp_trans_id number(10), trans_id number(10), resion_id number(10) )
or
type new_type_name is ...
Started by Yousui on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
It also has a set of fields, but it can also contain, TYPE_NAME1 and new_type....
An Object Type is rather different.
It has a set of typed fields, but that's about it.
A record type is a type that can be used like a record.
|
Ask your Facebook Friends
|
Having an object like this:
object integerObject=1;
And an object like this:
Type integerType=typeof(Int32);
How can be the integerType object used to cast the integerObject to the type of Int32
Started by Nikola Stjelja on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
The type of the object that integerObject refers to is already Int32 , albeit the boxed version.
|
|
Dear ladies and sirs.
Imagine the following perfectly legal type hierarchy:
class A<T> where T : A<T> { } class B : A<B> { public B():base(){} }
My question is given a statically compiled definition of A<> is it possible to emit...
Started by mark on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Of ModuleBuilder.DefineType which doesn't specify a parent type, and then use the TypeBuilder.SetParent method to set the parent to the recursive type (using an argument something like typeof(A<>, in case you have some extra logic ....
|
|
Hi there,
I was thinking of implementing a per-object Repository (e.g. a Person repository, a State repository etc.) before deciding on a line of business Repository instead BUT I still have a question regarding the passing in of an ID (identifier) type...
Started by Mike Kingscott on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Drop that..
Your TID constraint is saying that TID will be of type Type.
IList is safe.
Array yes depending.
IList yes.
IQueryable no.
That should do the trick.
Just drop the where TID : Type constraint.
|
|
Why does this work:
public IList<ICoupon> GetCouponsForSite(string siteSlug) { var coupons = _db.Coupons.Where(x => x.Site.slug == siteSlug) .Select(x => new Coupon(x.id)); var list = new List<ICoupon>(); foreach (var coupon in coupons...
Started by Martin on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
So instead of an explicit cast after the Select as proposed by others (which not too type of the Coupons collection.).
type argument.
|
|
Sorry if the title seems confusing, but some examples are in order.
Let's say I have some Java class with a generic type parameter:
public class GenericClass<T> { }
I can create a variable typed to store an object, with the generic parameter set...
Started by Adam Batkin on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
In order to make it work, you could do something like
List<? extends GenericClass<?>> generic = stringy
which should... .
Technically, that's because List<GenericClass<String>> is not a subtype of List<GenericClass<?>> .
|
|
How is the association of type and parameter different in a dynamically typed language than a statically typed language?
Started by shalini on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
This should be helpful:
Dynamic type languages versus static type languages.
A static type, albeit possibly of a rather sophisticated nature.
|
|
What is
Type<Type> type;
called (opposed to)
Type type;
You know, where you put the angle brackets around the type? I use this a lot, but don't know the name - it's bugging me. It's very hard to search for - Google ignores the <> characters...
Started by Isaac Waller on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
I'm just looking for a share of the....
(Hey, two people already posted the same thing as each other and both got ~3 upvotes .
Generics! :)
Generics: http://java.sun.com/j2se/1.5.0/docs/guide/language/generics.html
Generics or parameterized types.
|