Print Page | Close Window

Custom Type

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2850
Printed Date: 13-Apr-2026 at 8:59am


Topic: Custom Type
Posted By: Togas
Subject: Custom Type
Date Posted: 26-Jul-2011 at 12:08pm
I'm having trouble getting my custom type to populate.

This works:
<DataContract()>
Public Class Employee
  Implements IKnownType

  <DataMember()>
  Public Property UserId As Integer
  <DataMember()>
  Public Property FirstName As String

End Class
'From my viewmodel
Dim q2 = _mgr.EmployeeYearbooks.Select(Function(emp) New Employee With {
                                             .UserId = emp.UserId,
                                             .FirstName = emp.EmployeesOMD.FirstName}
                                             )

    q2.ExecuteAsync(Sub(e) e.Results.ForEach(Sub(ee) Employees.Add(ee)))

But when I add one property it stops working, any thoughts?
This doesn't work.

<DataContract()>
Public Class Employee
  Implements IKnownType

  <DataMember()>
  Public Property UserId As Integer
  <DataMember()>
  Public Property FirstName As String
  <DataMember()>
  Public Property BirthPlace As String

End Class


'From my viewmodel
    Dim q2 = _mgr.EmployeeYearbooks.Select(Function(emp) New Employee With {
                                             .UserId = emp.UserId,
                                             .BirthPlace = emp.BirthPlace,
                                             .FirstName = emp.EmployeesOMD.FirstName}
                                             )

    q2.ExecuteAsync(Sub(e) e.Results.ForEach(Sub(ee) Employees.Add(ee)))







Replies:
Posted By: DenisK
Date Posted: 28-Jul-2011 at 3:54pm
Hi Togas;

This is strange. All you did was just add 1 more property, BirthPlace, and it "stops working". Could you elaborate what you mean by "stops working"? What were you expecting and what were you observing?



Print Page | Close Window