subsonic

SubSonic 3 Simple Query Tool

好久不见. 提交于 2019-12-11 15:49:51
问题 I want to use the Simple Query tool in SubSonic 3(.0.0.2) and the docs page (http://subsonicproject.com/docs/Simple_Query_Tool) implies there's a way to easily get hold of table column names (e.g. Product.ProductNameColumn): int records = new Select(Product.ProductIDColumn, Product.ProductNameColumn). From<Product>().GetRecordCount(); The ActiveRecord generated class doesn't appear to expose this info - there is no ProductIDColumn property. Is this a hang-up from version 2? 回答1: There's no

Error with Subsonic attempting to convert Timespan to String

会有一股神秘感。 提交于 2019-12-11 15:23:48
问题 using Subsonic v3.0.0.3 with MS SQL 2008 (10.0.2531) and have two columns in a table 'Date' and 'Time' ( not DateTime columns) and when the ActiveRecord SingleOrDefault (line 14110) attempts to load the object (via a given pkid) this error is thrown; "Object of type 'System.TimeSpan' cannot be converted to type 'System.String'." Any idea on how to work around this? The part that fuzzles me is MS SQL doesn't have a 'Timespan' column type. 回答1: Date and Time column types are not currently

SubSonic 2.1 and Oracle problems

白昼怎懂夜的黑 提交于 2019-12-11 15:15:30
问题 Please if anyone knows the answer, I´m still looking for 3 days and nothing.. I make some test with subsonic, SqlServer and MySql and with some little changes in the web.config file everything was good. But now, I need to work with Oracle . I maked the changes and next command runs DataTable qry = ModeloDados.DB.Select().From("CARGO").ExecuteDataSet().Tables[0]; But if i type the ModeloDados. the class doesn´t appear. Ony appear the next : DB , Schemas , SPs , Tables , Views With the

How to use “one to many” relations in SubSonic

落花浮王杯 提交于 2019-12-11 11:05:43
问题 What are the ways to tell SubSonic about the relationship (only foreign keys? Or other methods too)? If I have (for example) a team object with related team members ** how do I access and update the team members from the team ** how do I update the team members? Does saving the team object saves the team members changes ** How do I add members to the team? Do I just create a new member, assign the team ID to the foreign key and save? Or is there a more object oriented way (e.g. team.Add

How to delete all records in a table using SubSonic 3

点点圈 提交于 2019-12-11 08:41:01
问题 I'm trying to delete all the records from a table using this approach: new Delete<Contact>().Execute(); This statement fails with a NullReferenceException in BuildDeleteStatement method at line: sb.Append(query.FromTables[0].QualifiedName); Because, although FromTables has one entry, it is set to null. I also tried this but it doesn't worked either: var provider = ProviderFactory.GetProvider("MonitorData"); new Delete<Contact>(provider).Execute(); What am I doing wrong? 回答1: You can do this

SubSonic.Query vs SubSonic.SqlQuery

喜你入骨 提交于 2019-12-11 08:33:59
问题 I've been using SubSonic.Query all these while, until one day when I can't do "IS NULL" by adding WHERE, then I realized that SubSonic.SqlQuery existed and it has a function of "IsNull()". After checking out the source code, Query and SqlQuery is not inherited in any way, so what's their major difference and how to decide which to use? Edit: I just realized that I could actually do "IS NULL" by using "Comparison.Is". That makes me even more confuse as both SqlQuery and Query can almost do the

N Tiers with SubSonic 3, Dirty Columns collection is always empty on update

久未见 提交于 2019-12-11 08:18:23
问题 Here is what I am doing, and not working for me. I have a DAL generated with SubSonic 3 ActiveRecord template, I have a service layer (business layer if you well) that have mixture of facade and some validation. Say I have a method on the Service layer like public void UpdateClient(Client client); in my GUI i create a Client object fill it with some data with ID and pass it to the service method and this never worked, the dirty columns collection (that track which columns are altered in order

Subsonic How to select between date

*爱你&永不变心* 提交于 2019-12-11 07:45:52
问题 Could anyone tell me how to do the select function in SubSonic project to query all customer who will have birthday in next two week from today. Table Customer Name Thomas DOB 19/09/1981 Thank you 回答1: If you're only using one provider (most people are) and you want to take advantage of the table structs that SubSonic generates for you: CustomerCollection customers = DB.Select().From(Customers.Schema) .Where(Customers.Columns.CustomerName).IsEqualTo("Thomas") .And(Customers.Columns.DOB)

What happen to Subsonic…seen like no futhere development

风流意气都作罢 提交于 2019-12-11 06:46:36
问题 It has been a long time since Subsonic have stopped at version 3. Any new development going on? Thanks 回答1: We're releasing version 3.1 soon. If you take a look at the github repository at http://github.com/subsonic/SubSonic-3.0 you'll see that the project is not dead at all. You'll find a roadmap for 3.1 (scattered over a couple of threads) on google groups http://groups.google.com/group/subsonicproject 回答2: The github repos have very little activity and the referenced url for the website is

Adding properties to an existing object retrieved using SubSonic

与世无争的帅哥 提交于 2019-12-11 06:36:57
问题 I think this is more of a polymorphism question but it applies to SubSonic table objects... Here's the thing (and I love this one): TblUser userObj = new TblUser(1); Which fills userObj's properties with all of PK=1's goodies. Now, I'd like to add more properties to the existing user object, for example, an ArrayList property of say, account numbers. I've seen questions like this around - "add a property to an existing object...", but in this case, would it be most-recommended to create a