c# - NHibernate: Should I encode inputs? -


I use NHibernate to continue my objects .. However, I have not received any information about this Is that I need to encrypt the input or not?

For example:

  string first name = textbox first name Text; String lastName = textbox label Text; (Using anation session = session factoring.options ()) {customer customer = new customer (first name, last name); Session.SaveOrUpdate (customer); }  

Do I need to encode first name and last name (especially single qoutes) or do I need NHibernate Do this?

A customer example is simply an object within your object model. That's all. NHibernate is just behind the scenes - this is a window through which you can access your domain model.

NHibernate ensures that your domain model is correctly maintained. It needs to do a lot without you, such as encoding string properties on your object.

In addition, if you are creating a new customer example, and you want to notify NHibernate of the new installation, then you need to enter the API method ISession. Save should use instead of , ISession.SaveOrUpdate . API method issation Save will save the new instance in the domain model (and, transparently, in the database).


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -