Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

Writing computed properties with NHibernate -


i'm using nhibernate 2.1.2 + fluent nhibernate

i have contactinfo class , table. name column encrypted in database (sql server) using encryptbypassphrase/decryptbypassphrase.

the following relevant schema/class/mapping bits:

table contactinfo(   int id,   varbinary(108) name)  public class contactinfo {   public virtual int id { get; set; }   public virtual string name { get; set; } }  public class contactinfomap : classmap<contactinfo> {   public contactinfomap()   {     id(x => x.id);     map(x => x.name)       .formula("convert(nvarchar, decryptbypassphrase('passphrase', name))");   } } 

using formula approach above, values read correctly database, nhibernate doesn't try insert/update values when saving database (which makes sense).

the problem able write name value using corresponding encryptbypassphrase function. i'm unsure if nhibernate supports this, , if does, haven't been able find correct words search documentation it.

so... how can write computed property database nhibernate?

thanks in advance!

a property mapped formula read-only.

a named query wrapped in contactinfonameupdater service might 1 way solve problem.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -