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
1
vote
1 answer

ReflectionTypeLoadException in Simple.Data using PostgreSql

I am trying to open PostgreSQL connection but getting ReflectionTypeLoadException while opening connection. Please help me out to solve this problem by providing code or let me know how to remove this exception. Code i am using so far is below: …
1
vote
2 answers

Simple.Data insert complex object

It's my first day with Simple.Data. I am migrating my project from pure ADO .NET. I have an Order table with columns: Id CreationDate CustomerId -> FK to Customer table And an Order class in my project: int Id DateTime CreationDate Customer…
GrzegorzM
  • 842
  • 8
  • 19
1
vote
0 answers

Accessing Simple.Data Table with Schema name throws error

I am using Simple.Data for Oracle version 0.18.3.1 in an Asp.Net MVC 4 application. It works fine with tables which dont precede by schema name but crashes when I try to get data from a table which MUST be preceded schema name. The error I receive…
Aamir
  • 1,747
  • 5
  • 26
  • 50
1
vote
2 answers

How to execute multiple DB calls asynchronously using Simple.Data

I am using Simple.Data with SQL Server and I have multiple methods that are independent of each other. On a form I have multiple drop down lists that need to be populated and I think these can be populated asynchronously. I have a repository that…
Afraz Ali
  • 2,672
  • 2
  • 27
  • 47
1
vote
0 answers

Simple.Data InMemoryAdapter - FindAllByX(IEnumerable)

Like the title says, is it some way to make this statemant work (using InMemoryAdapter): Database.Open().MySchema.MyTextResource.FindAllByX((IEnumerable)myVariable); IT returns 0 rows now, but if i…
Lars Stenberg
  • 241
  • 1
  • 11
1
vote
1 answer

Upserting column add to current value with simple.data

Trying to upsert with simple.data and i would like to add to current value if matched, and otherwise just use provided value. This fails if Id=13 does not exist. var table = db.TheTable2; table.UpsertById(Id: 13, Value: table.Value + 10); // Want a…
Lars Stenberg
  • 241
  • 1
  • 11
1
vote
1 answer

Update field using same field as key with Simple.Data

I want to achieve this: UPDATE MyTable SET Field1=Field1 + 1 WHERE Field2 = 1 AND Field1 = 5000 Just to explain why is that im verifying that nobody else touched the record, Field1 is a sequence number. How to achieve this, im thinking something…
Lars Stenberg
  • 241
  • 1
  • 11
1
vote
1 answer

Simple.Data Insert Object - List initializers must contain at least one initializer

When I run the following code : var db = Database.Open(); var contact = new Contact() {FirstName = "Mark", LastName = "Rendle"} ; db.Contacts.Insert(contact); I get an error : List initializers must contain at least one…
youeee
  • 95
  • 3
  • 9
1
vote
1 answer

How do I correctly perform an eager load in Simple.Data?

When I try to do an eager load (.WithXyz() method), I get the wrong data back. It tries to do a join using the primary Id of both tables, rather than the "property" on the main table joined to the Id of the secondary table. Is this a bug in my code,…
Merlyn Morgan-Graham
  • 58,163
  • 16
  • 128
  • 183
1
vote
1 answer

Simple.Data Select specific columns

I have a call made to Simple.Data where I want to limit the columns that are being brought back. However I am hitting problems.. This works fine: var db = Database.Open(); var questionIdRow = db.Question.FindByFriendlyId(friendlyId); if…
Ash
  • 5,057
  • 7
  • 35
  • 49
1
vote
1 answer

Alias column mapping in simple.data for DML

Is there any one using Simple.Data ORM https://github.com/markrendle/Simple.Data. Any idea how to implement alias column names and table names for all the DML operation. I've referred http://simplefx.org/simpledata/docs/ . It talks about alias in…
kjana83
  • 398
  • 3
  • 16
1
vote
1 answer

Simple.Data Distinct with InMemoryAdapter

I'm using Simple.Data and its InMemoryAdapter to write some tests. The code below is from one of my tests. The test should result in 1 value "Atlanta" being returned, however I get Atlanta twice. I'm wondering if I'm using InMemoryAdapter of…
Dave
  • 3,812
  • 5
  • 31
  • 39
1
vote
1 answer

Named argument 'ArgName' cannot be specified multiple times

Please can somebody help me on the above question? I am using SimpleData in my project and trying to update records as follows but get the error mentioned above. var releasedHosts = show_crm.tblName.Update(ID: Id, ID: newId); Error Message: Named…
LiaqatG
  • 367
  • 1
  • 3
  • 17
1
vote
2 answers

Simple.Data casting to ToList()

I am using Simple.Data and want to know if I can Select a single column and then cast it to a list of string values. For example using the query below I get the error: Cannot implicitly convert type 'Simple.Data.SimpleRecord' to 'string' var result…
Dave
  • 3,812
  • 5
  • 31
  • 39
1
vote
2 answers

Simple.Data join without where clause including any primary table columns

I am using Simple.Data and have been trying to find an example that will let me do a join with the only condition in the WHERE clause be from the joined table. All of the examples I have seen always have at least one column in the primary table…
Joe Kuemerle
  • 6,338
  • 1
  • 23
  • 18
1 2 3
8 9