Questions tagged [subsonic-simplerepository]
16 questions
9
votes
3 answers
ORM Comparison: Which comes first the database or classes?
Lately I've been looking into the .NET based ORMs that are available. I've noticed that each ends up siting in one or two camps. In one camp the database is created first, and the ORM provides an easier way to access the database in an application.…

Eric Anastas
- 21,675
- 38
- 142
- 236
4
votes
2 answers
Select doesn't work on IQueryable but does on IList
I have two lines of code, one is
AllItems().Where(c => c.Id== id)
.Select(d => new Quality(d.QualityType)).ToList();
and the other one
AllItems().Where(c => c.Id== id).ToList()
.Select(d => new…

kay.one
- 7,622
- 6
- 55
- 74
4
votes
1 answer
SubSonic 3 simple repository question
I am using simple repository pattern of Subsonic 3 to store and get values from database. I want to know if I should use Singleton patten to create SimpleRepository or should create one whenever is needed. Like if I have Person class like…

TheVillageIdiot
- 40,053
- 20
- 133
- 188
3
votes
0 answers
Invalid Object Name Exception Thrown on Update
I have a project using Simple Repository which was working before I rebuilt my dev machine. This may just be coincidence but I am now using SQL Server 2008 Express to develop against rather than 2005 and now when I run my project I get the exception…

ProNotion
- 3,662
- 3
- 21
- 30
2
votes
1 answer
Subsonic 3 - Simple repository and creating a foreign key
There seems to be hardly any examples out there so here goes:
Here are my three structures but it doesn't seem to create the tables properly and when I call the following line it says Id is not recognised:
IEnumerable permissions =…

Andrew
- 9,967
- 10
- 64
- 103
1
vote
1 answer
SubSonic column named 'Key'
I have a column named 'Key' in a MySQL database. Seems that the
repo.Find(x=>x.Key.StartsWith("BLAH"));
generates the SQL code
WHERE Key LIKE 'BLAH%'
instead of the correct one like
WHERE `Key` LIKE 'BLAH%'
How can I force the later…

qdot
- 6,195
- 5
- 44
- 95
1
vote
2 answers
Get Id back when using SubSonic SimpleRepository AddMany
How can I get the Id back to the object when I'm using the AddMany function with SubSonic SimpleRepository. All my objects still get Id=0 when after using it.
SimpleRepository repository = new…

Andreas
- 1,311
- 5
- 24
- 39
1
vote
0 answers
SubSonic3 SimpleRepository Relationships Generated are Wrong
I have been told that it's more than likely my database that is setup wrong causing the problems so below are my tables with key fields and queries.
CREATE TABLE Presentations (
Id INT NOT NULL IDENTITY(1, 1),
SpeakerId INT NOT NULL,
…

Daniel Draper
- 259
- 3
- 15
1
vote
1 answer
Funky Sql Generated using SubSonic Simple Repository, LINQ and ASP.NET MVC
I have the following code:
if (collection["Filter"] == "2") {
presentations = presentations.Where(x => x.Speaker.FirstName.StartsWith("B")).
OrderBy(x => x.Speaker.FirstName);
}
this generates the following sql:
SELECT [t0].[Description],…

Daniel Draper
- 259
- 3
- 15
0
votes
1 answer
SubSonic AddMany() vs foreach loop Add()
I'm trying to figure out whether or not SubSonics AddMany() method is faster than a simple foreach loop. I poked around a bit on the SubSonic site but didn't see much on performance stats.
What I currently have. (.ForEach() just has some validation…

Justin williams
- 574
- 1
- 8
- 26
0
votes
2 answers
SubSonic SimpleRepository storing member class
I'm new to C# and Subsonic. I'm trying to solve the following case:
public class UnknownInt {
public int val;
public bool known;
}
public class Record {
public int ID;
public UnknownInt data;
}
I'm using SimpleRepository.
Is there a way…

qdot
- 6,195
- 5
- 44
- 95
0
votes
1 answer
Subsonic ignoring TimeSpan property
For some reason the TimeSpan property on my class is not being persisted into the database by Subsonic it is simply being ignored!? All other properties are being saved OK. I am using SimpleRepository and RunMigrations, Subsonic v3.0.0.3.
public…

ProNotion
- 3,662
- 3
- 21
- 30
0
votes
2 answers
SimpleRepository auto migrations with indexes
I am using subsonic simplerepo with migrations in dev and it makes things pretty easy but I keep running into issues with my nvarchar columns that have an index. My users table has an index defined on the username column for obvious reasons but each…

scott
- 385
- 4
- 8
0
votes
1 answer
how to implement unitofwork pattern when using subsonic 2.1(Repository pattern)?
I am using subsonic repository pattern(2.1) for asp.net mvc application.In my application,there are many repositories like categoryRepository,Blogrepository etc.Inside each of this repository i am calling subsonic's…

Rohith
- 5,527
- 3
- 27
- 31
0
votes
1 answer
SubSonic, SimpleRepository and entity interfaces
Firstly, I want to apologize for my English, not my strongest side.
To the question. In my current project, I have interfaces to my entities so I can use Subsonic attributes at my head entites and I want to be able to seamlessly switch O/R mapper in…

Timmie Sarjanen
- 411
- 4
- 18