subsonic

Parent and Child object in SimpleRepository

混江龙づ霸主 提交于 2019-12-14 03:43:52
问题 How would it work in Subsonic's SimpleReporitory if I wanted to be able to have a 1 to many relationship between objects? Would I have to create a bridge object and then build my parent object at runtime, or is this support built in? What I am looking for is the folowing: Adam's Example Shop... Public Class Shop Private m_id As Integer Private m_Name As String Private m_Employees As List(Of Employee) Public Property Id() As Integer Get Return m_id End Get Set(ByVal value As Integer) m_id =

SubSonic .Filter() in memory filter

為{幸葍}努か 提交于 2019-12-14 02:25:45
问题 i'm having some issues getting the .Filter() method to work in subsonic, and i'm constantly getting errors like the one below: Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. Line 36: bool remove = false; Line 37: System.Reflection.PropertyInfo pi = o.GetType().GetProperty(w.ColumnName); Line 38: if (pi.CanRead) Line 39: { Line 40: object val = pi.GetValue(o, null); i'm making calls like the one below- is this the corrent way to use it?

SubSonic 3 Installation Doesn't Work?

匆匆过客 提交于 2019-12-13 18:40:26
问题 Ok I have following the tutorial here as best I can http://subsonicproject.com/docs/Setting_up_SubSonic_3.0 As the files you get in the download are nothing like what is shown in the video?? So I am literally just guessing which files to use?? Then I drag the files / folders into Visual studio (As the video shows) and NOTHING happens?? It just adds the files to my solution?? Or adds the folders to my solution as normal files... Nothing gets executed as shown in the video?? I realise Rob has

Subsonic 3.0 MVC and paragraph control

眉间皱痕 提交于 2019-12-13 06:33:18
问题 I have a subsonic 3.0 MVC site. Is it CMS based? if yes how can I use subsonic's paragraph control. If it's not CMS based then from where I can get it? The subsonic 3.0 on http://subsonicproject.com/ does not contains the CMS? 回答1: Subsonic 3 is merely used to provide Data Access and class mapping through t4 templates. There is no CMS. The worrying sentence in your question is " If its not CMS based then from where i can get it?". If its not cms based then you can't get it from anywhere. It

Delete multiple records from a table using subsonic T4 templates?

*爱你&永不变心* 提交于 2019-12-13 06:31:59
问题 Using templates, how can I delete multiple records from a table in same Delete statement? 回答1: Your question's a bit ambiguous but based on another question you've posted I think you're trying to delete based on a list of Ids or something similar. You can do that using a fluent query as follows: List<int> peopleIds = new List<int> { 121, 122, 35, 4 }; new SubSonic.Query.Delete<Person>(new MyDB().Provider) .Where(PersonTable.IdColumn).In(peopleIds) .Execute(); 来源: https://stackoverflow.com

Subsonic 3.0 testing - what am I missing here?

こ雲淡風輕ζ 提交于 2019-12-13 04:22:09
问题 EDIT: This issue is already submitted on Github. Changing the "Act" part to this will make the test pass var result = Adresse.All() .Where(x => x.AdresseX == txt1 && x.PostBy == txt2) .FirstOrDefault(); [TestMethod] public void WTF() { //Arrange string txt1 = "Vingsted Skovvej 1"; string txt2 = "7100 Vejle"; var one = new Adresse { ID = 1, AdresseX = "Vejlevej 55", PostBy = "7300" }; var two = new Adresse {ID = 2, AdresseX = txt1, PostBy = txt2 }; Adresse.Setup(new List<Adresse> { one, two })

subsonic 3 - Object of type 'System.Byte[]' cannot be converted to type 'System.String'

时间秒杀一切 提交于 2019-12-13 03:55:03
问题 I have this piece of code that works fine in subsonic 2.2, I migrated to subsonic 3 but now i get this error 'Object of type 'System.Byte[]' cannot be converted to type 'System.String'.' subsonic 2.2 code in comment public IList<Tag> Tags { get { return Tag.Find(t => t.TypeId == 1 && t.ItemID == JobId).ToList(); // new TagCollection().Where(Tag.Columns.TypeId, 1) // .Where(Tag.Columns.ItemID, JobId).Load(); } } Where TypeId and ItemId are int how can this be fixed ? 回答1: Are you using the

“Lambda Parameter not in scope” exception using SimpleRepository's Single method

走远了吗. 提交于 2019-12-13 03:45:06
问题 I'm attempting to use the SimpleRepository to perform a fetch based on a non-ID property. Here's the Customer class I'm using: [Serializable] public class Customer : IEntity<Guid> { public Guid ProviderUserKey { get; set; } public Guid ID { get; set; } } I'm using SimpleRepository with migrations turned on. The code that throws the "Lambda Parameter not in scope" is below: public class CustomerRepository : ICustomerRepository { private readonly IRepository _impl; public CustomerRepository

Working with SubSonic 'deleted' rows

扶醉桌前 提交于 2019-12-13 03:32:34
问题 When loading data with SubSonic (either using ActiveRecord or a collection), only records with IsDeleted set to false will load. How can I show those rows that have been deleted? For example, deleting an Employee with: Employee.Delete(1) Now employee 1 is marked as deleted. Now I want the option to undo the delete and / or show a list of deleted employees, how can I do that? Either it will be undone if the user accidentally deleted the employee, or they want to go to a 'trash' list with

subsonic, mvc and activerecord

雨燕双飞 提交于 2019-12-13 02:56:21
问题 i am using subsonic 3.0 and active record with a mysql database now everything is fine, but i cant seem to create views see example: public ActionResult Index() { return View(contact.GetPaged(1,20)); } now normally i would right click and choose Add View i would then choose strongly typed and find the class for the repositary however for some reason the only classes i get showing up are for subsonic only but expect to see the new class from the new generated graniteMysqlDB if anyone could