Castle ActiveRecord یک ابزار کمکی برای استفاده راحتتر از NHibernate است. NHibernate خودش هم یک ORM کد باز داتنتی معروف است. در واقع میتوان Castle ActiveRecord را یک ORM خیلی راحت دانست. بسیاری افراد فکر میکنند استفاده از ORMها و تنظیمات آنها کار خیلی سختی است. اما من در اینجا میخواهم در چند قدم ساده …
We have a typical web application that its data access layer is written using Castle ActiveRecord. Castle ActiveRecord exposes NHibernate’s SchemUpdate feature. This feature lets us to upgrade schema/database with current changes in domain entities. One odd problem with SchemaUpdate was that in many cases it was generating foreign keys again without any change in …
NHibernate has a feature named “Schema Update”. This feature help updating schema of existing database based on new changes in mapping files. Schema update do not change current data, just changes schema (table, view, … structure) in an additive manner. Castle ActiveRecord exposes this feature too. The problem is with NHibernate you have choice for …
من مشکلی با NHibernate دارم که نمیدانم آیا بقیه هم این مشکل را با NHibernate یا دیگر ORMها یا حتی ADO دارند یا نه. البته اصل این مشکل در صفحات ASP.NET Webform وجود دارد. مشکل این است که وقتی میخواهم یک آیتم را در دیتابیس ذخیره کنم یا حتی وقتی میخواهم یک رکورد را روی …
گاهی اوقات که میخواهیم روش استفاده از فلان متود یا کلاس یک Library خاص را دانسته یا میخواهیم چند نمونه کد با آن پیدا کنیم، یک راهش استفاده از سورسهای Online کتابخانهی مورد نظر است. البته به شرط آن که Library یا برنامهی مورد نظر Open Source بوده و سورس کد آن به صورت Online …
If you are a Castle ActiveRecord user you may currently encountered situations that it is needed to do some specific operation that is possible just via NHibernate or even just need to direct access to NHibernate’s ISession. For example if you want to use LINQ-to-NHibernate or run SQL query with Castle ActiveRecord, there is no …
BelongsTo is a attribute in Castle ActiveRecord that is used to mark an association as many-to-one. For example consider following class diagram. There is an association between Student and Teacher named ArtStudent. This is a many-to-one association so you must add BelongsTo attribute to Student class as showed in following code snippet. [ActiveRecord(Lazy = true)]public …
I was searching for tools that generate Castle ActiveRecord domain classes from databases tables and here is my list of findings: 1. ActiveWriter:Is a visual tools that you can draw your class diagrams with it. It has versions for VS 2005 and VS 2008 but I’m not sure about VS 2010. 2. My Generation:A general …
ASP.NET GridView and other similar controls that support paging needs special methods that return only the requested slice of data and the count of total data. As I’m a lover of NHibernate/Castle ActiveRecord I have gathered paging techniques in NHibernate HQL, LINQ-to-NHibernate and Castle ActiveRecord: NHIbernate HQL: public IList GetData(int page, int pageSize, ref long …
I was used to use entlib for logging. But as I’m in favour of open source and because I am using NHibernate and Castle ActiveRecord in my applications, decided to use log4net instead. So found a good article about it, and enabled it for my application. But the problem was a very huge log file …