Closed GusBeare closed 2 years ago
As currently written, Mighty assumes integer PKs. You should be able to treat Franchise
as a table with no PK and have the above work. You'll need to fetch by using method overloads which accept explicit column name and value (e.g. the first example here https://mightyorm.github.io/Mighty/docs/getting-started.html#reading-multiple-rows ) - rather than just PK value as you can when you have specified the integer PK column.
Thanks Mike. Yes this works fine.
MightyOrm franchise = new MightyOrm(cn, "Franchise");
IEnumerable<dynamic> allFranchises = franchise.All();
var row = allFranchises.FirstOrDefault();
I'm playing with 4.0.0-aplha-3 in .Net 5. I have a table with a Guid PK. When I try to insert like this:
On the line db.New() I get "InvalidCastException: Invalid cast from System.String to System.Guid".
Does Mighty handle Guid PK's?