Click here to Skip to main content
14,699,643 members

Comments by TheRedEye (Top 7 by date)

TheRedEye 20-Jun-20 2:54am View
Thanks Gerry. Your last statement sounds contradictory unless I'm misunderstanding. Aren't the EF entities the Model in the V-VM-M-DAL? And aren't the custom POCOs the viewmodels in the V-VM-M-DAL?
TheRedEye 31-Aug-18 10:43am View
Yes, its unmanaged code.Thanks Richard, unmanaged dll is what I should have been googling help with.
TheRedEye 30-Aug-18 5:36am View
All the searched examples that show refection as the solution make use of .Net assemblies. This DLL isn't a .net assembly, it's LabView made library.
TheRedEye 4-Nov-15 7:17am View
So in the above example, please correct me I'm wrong with any of this.

ListOfThings and MyItems are pointers to the same object in the heap. So calling FreeAndNil(ListOfThings) will also free MyItems. And MyItems is the parent and owner of every instance of AnItem. So when MyItems is freed, then all the instances of AnItem are also freed. Is this correct?
TheRedEye 3-Nov-15 8:47am View
Thanks for your reply, the articles helped. In the following code does the FreeAndNil(ListOfThings) free all necessary objects?

function GetList(): TObjectList<tsomeobject>;
MyItems: TObjectList<tsomeobject>;
AnItem: TSomeObject;
i: integer;
MyItems := TObjectList<tsomeobject>.Create();
for I := 0 to 9 do
AnItem := TSomeObject.Create();
MyItems.Add(AnItem); // MyItems becomes owner of each AnItem.
Result := MyItems;

procedure DoSomething();
ListOfThings: TObjectList<tsomeobject>;
ListOfThings := GetList();
// ....
FreeAndNil(ListOfThings); // will this free ListOfThings, MyItems and all 10 of AnItem objects?
TheRedEye 16-Jul-14 10:27am View
Yes, but specifically, what SQL statements are generated. I'm trying to see if I can get a performance improvement here. Does my example make 3 round trips to the server or just one?

Linq will normally build a sql statement and only execute that statement against the database when the collection is iterated. However I cannot find any documentation on when/how linq-to-sql stored proc execute the built sql statement.

I've also tried using LINQPad to see the sql generated, but strangely stored procs in LINQPad seem to return a 'ReturnDataSet' data type as opposed to visual studio which returns ISingleResult<testlinqresult> as the anonymous type.
TheRedEye 18-Sep-12 6:21am View
Thanks andrevdcolff, you're a hero. Works great.