Click here to Skip to main content
15,898,943 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: WebUIValidation.js and .NET 2.0 upgrade. Pin
Not Active4-Feb-09 1:18
mentorNot Active4-Feb-09 1:18 
GeneralRe: WebUIValidation.js and .NET 2.0 upgrade. Pin
imnotso#4-Feb-09 1:20
imnotso#4-Feb-09 1:20 
GeneralRe: WebUIValidation.js and .NET 2.0 upgrade. Pin
Colin Angus Mackay5-Feb-09 12:35
Colin Angus Mackay5-Feb-09 12:35 
GeneralRe: WebUIValidation.js and .NET 2.0 upgrade. Pin
imnotso#5-Feb-09 22:57
imnotso#5-Feb-09 22:57 
GeneralRe: WebUIValidation.js and .NET 2.0 upgrade. Pin
Colin Angus Mackay5-Feb-09 23:23
Colin Angus Mackay5-Feb-09 23:23 
GeneralRe: WebUIValidation.js and .NET 2.0 upgrade. Pin
imnotso#5-Feb-09 23:35
imnotso#5-Feb-09 23:35 
QuestionThe specified module could not be found. (Exception from HRESULT: 0x8007007E [modified] Pin
tsanthosh3-Feb-09 22:42
tsanthosh3-Feb-09 22:42 
QuestionHi guys - is it possible to cast generic up the specific types hierarchy??? Pin
netguruMelb3-Feb-09 20:59
netguruMelb3-Feb-09 20:59 
Hi guys,

Im wondering if its possible to SOMEHOW convert a class that inherits from an abstract base generic class and to convert the subclassed instance back up to it parent??? It seems it can be done for some reason. Here is my scenario:

Public MustInherit Class EntityCollectionBase(Of TEntity As {EntityBase, IEntity})

Public Class BillingPeriodCollection Inherits EntityCollectionBase(Of BillingPeriodEntity)

End Class

NOTE : BillingPeriodEntity inherits from EntityBase (which implements IEntity)

So if i have code such as the following:

Dim bpc As New BillingPeriodCollection()

LoadCollection(CType(bpc, EntityCollectionBase(Of EntityBase))) *** THIS WONT COMPILE DAMN IT!!!

Private Sub LoadCollection(ByVal collection As EntityCollectionBase(Of EntityBase))

End Sub

My question is this : Why doesnt this damn thing compile? All im trying to do is take a specific instance of a generic typed collection, and simply cast it back up since the type being stored is actually a subclass of the parent (ie. BillingPeriod inherits EntityBase).... Just as BillingPeriodCollection inherits EntityCollectionBase....

It would seem VERY viable that this should be done.... For example if i had a generic list of FORD cars and that inherits from CAR, surely its possible to cast a list of FORDS back up to a list of CARS... That way i can then handle all models at the CAR level generically.... which is what im trying to do in my real app based on code above...
AnswerRe: Hi guys - is it possible to cast generic up the specific types hierarchy??? Pin
Gideon Engelberth4-Feb-09 3:33
Gideon Engelberth4-Feb-09 3:33 
AnswerRe: Hi guys - is it possible to cast generic up the specific types hierarchy??? Pin
supercat94-Feb-09 5:17
supercat94-Feb-09 5:17 
QuestionFinding a given day or weekday x months from today Pin
nzmike3-Feb-09 14:34
nzmike3-Feb-09 14:34 
GeneralRe: Finding a given day or weekday x months from today Pin
Luc Pattyn3-Feb-09 16:13
sitebuilderLuc Pattyn3-Feb-09 16:13 
AnswerRe: Finding a given day or weekday x months from today Pin
Jon Rista3-Feb-09 16:19
Jon Rista3-Feb-09 16:19 
AnswerRe: Finding a given day or weekday x months from today Pin
nzmike3-Feb-09 16:25
nzmike3-Feb-09 16:25 
GeneralRe: Finding a given day or weekday x months from today Pin
Luc Pattyn3-Feb-09 17:30
sitebuilderLuc Pattyn3-Feb-09 17:30 
GeneralRe: Finding a given day or weekday x months from today Pin
Jon Rista4-Feb-09 6:25
Jon Rista4-Feb-09 6:25 
AnswerRe: Finding a given day or weekday x months from today Pin
cmk3-Feb-09 20:45
cmk3-Feb-09 20:45 
QuestionSmart Card Pin
Mohd Atiq3-Feb-09 1:38
Mohd Atiq3-Feb-09 1:38 
AnswerRe: Smart Card Pin
annathor5-Feb-09 1:52
annathor5-Feb-09 1:52 
Questionbook Pin
welcan3-Feb-09 1:02
welcan3-Feb-09 1:02 
AnswerRe: book Pin
EliottA3-Feb-09 7:10
EliottA3-Feb-09 7:10 
AnswerRe: book Pin
vaghelabhavesh3-Feb-09 8:38
vaghelabhavesh3-Feb-09 8:38 
QuestionOracle Transactions Handling in ASP .NET Pin
summon_192-Feb-09 23:04
summon_192-Feb-09 23:04 
AnswerRe: Oracle Transactions Handling in ASP .NET Pin
Wendelius3-Feb-09 7:54
mentorWendelius3-Feb-09 7:54 
QuestionSerialization of List<> and Remoting [modified] Pin
Andez20042-Feb-09 22:00
Andez20042-Feb-09 22:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.