Questions tagged [simple.data]

Simple.Data is a lightweight framework that uses the dynamic features of .NET 4 to provide an expressive, ORM-ish way of accessing and manipulating data without any of the code pre-generation and boilerplate required by other frameworks.

Simple.Data is a lightweight framework that uses the dynamic features of .NET 4 to provide an expressive, ORM-ish way of accessing and manipulating data without any of the code pre-generation and boilerplate required by other frameworks. Instead, it interprets method and property names at runtime and maps them to your underlying data-store using a convention-based approach.

128 questions
13
votes
1 answer

Simple Data Unit of Work implementation

I'm trying to find an example implementation of the Unit Of Work pattern in Simple.Data. Does anybody have one? I'm currently using non generic repositories and have been told that implementing UoW is something to do.
Phil
  • 4,012
  • 5
  • 39
  • 57
10
votes
1 answer

Simple.Data ORM. The multi-part identifier could not be bound

I'm using Simple.Data ORM. I'm trying to make a query from two joined tables. This query works fine: dynamic alias; var candidatesRec = db.dbo.Candidates .FindAll(db.dbo.Candidates.CommonOfferId == commonOfferId …
Paweł Reszka
  • 1,557
  • 4
  • 20
  • 41
8
votes
3 answers

How to log generated sql queries out of Simple.Data ORM for .NET

How to log generated sql queries (without mysql profiler)? I'm using Simple.Data.Mysql
nidheeshdas
  • 1,097
  • 1
  • 11
  • 20
5
votes
1 answer

Enumerate dynamic members (and values) in a Simple.Data.SimpleRecord

I was trying to do some mapping with a Simple.Data.SimpleRecord and tried to iterate through the members: foreach (string memberName in Model.GetDynamicMemberNames()) { Console.Write Model.GetValueByMemberName(memberName); // or…
joeriks
  • 3,382
  • 8
  • 32
  • 42
5
votes
1 answer

Simple.data with stored procedure that returns multiple result sets

Is there a way to execute a stored procedure that returns multiple result sets with simple.data and how do you defferenciate between the two sets?
Dave
  • 3,812
  • 5
  • 31
  • 39
4
votes
2 answers

Mini-Profiler with Simple.Data

Is it possible to use Mini-Profiler with Simple.Data Library? I use it to get data from MySql like this: var db = Database.OpenConnection(ConnectionString); var book = db.Books.FindById(id); How can I user Profiler with this code?
user1224129
  • 2,759
  • 3
  • 27
  • 29
4
votes
1 answer

How can I manage changing data structures in MongoDb collections w/ Simple.Data?

We're currently using Simple.Data and the MongoDb adapter. When we've retrieved a document, we cast it into a POCO, e.g: (User)db.Users.FindById(1234); To begin with, this works quite well (heck yeah, no schema!). However, if we change the…
Morgan Bruce
  • 239
  • 1
  • 8
4
votes
2 answers

Upsert a list with Simple.Data

Trying to do a: var list = new List(); list.Add(new MyType() { PK1 = 1, PK2 = 2 }); list.Add(new MyType() { PK1 = 1, PK2 = 3 }); Database.Open().MySchema.MyTable.Upsert(list); Nothing seems to happen, do i need to do a foreach or can i…
Lars Stenberg
  • 241
  • 1
  • 11
4
votes
2 answers

Which of these is better practice for CRUD? Simple.Data or Dapper?

I'm using both Dapper and simple.Data in my application, Dapper for retrieving data only and other operations by Simple.Data. I just need to know if using Simple.Data is better approach in all operations except retrieval and is it the same in…
omab
  • 41
  • 5
4
votes
3 answers

Replacements to hand-rolled ADO.NET POCO mapping?

I have written a wrapper around ADO.NET's DbProviderFactory that I use extensively throughout my applications. I also have written a lot of code that maps IDataReader rows to POCOs. However, as I have tons of classes the whole thing is getting to be…
ScottD
  • 173
  • 5
  • 15
3
votes
1 answer

Simple.Data Many-to-many Issues

So I'm working through a simplified example of my hoped-for database that has the following tables: Contractors: Id, ContractorName Types: Id, TypeName CoverageZips: ContractorId, Zip TypesForContractors: ContractorId, TypeId where contractors can…
Tim Hall
  • 1,475
  • 14
  • 16
3
votes
3 answers

How to use a sql function (coalesce or isnull) in Simple.Data

I am porting a sql query to Simple.Data, the original query is something like: select a.Field1, a.Field2, b.Field1 from TableA a join TableB b ON a.KeyField = b.KeyField where coalesce(b.SomeDate, '1/1/1900') <= getdate() I've been able to port…
EricP
  • 33
  • 4
3
votes
1 answer

Simple.Data Group By

I'm new to Simple.Data. But i'm having a really hard time finding out how to do a 'group by'. What I want is very basic. Table looks like: +________+ | cards | +________+ | id | | number | | date | +________+ I want the equivalent of this…
Kevin Hicks
  • 435
  • 2
  • 14
3
votes
1 answer

SimpleData complex join and projection to poco type

I'm starting to use Simple.Data a bit more seriously and have the following scenario that doesn't seem to be working and I can't wrap my head around why not (probably something silly as I've been staring at it for a few hours). Basically db…
Phil
  • 4,012
  • 5
  • 39
  • 57
3
votes
0 answers

Simple.Data InMemoryAdapter throws "Operation is not valid due to the current state of the object."

Using the code below without using simple.data's InMemoryAdapter works just fine, when I switch to using a mock, I get an error thrown "Operation not valid due to the current state of the object" I am unfortunately able to rely on referential…
Hugo Forte
  • 5,718
  • 5
  • 35
  • 44
1
2 3
8 9