Does sombody knows a detailed example, that describes how nhibernate could be used in web services?
I have a silverlight application that must communicate with a web service (not WCF). The web service is using nHibernate to connect to the database. When calling the web method in the web service, a database name, loginID and pasword is passed.
[webmethod]
List<...> getCustomers(string dbname, string loginID, string password)
{ ...
}
I could set the connection string onto the configuration
Configuration cfg = new Configuration();
cfg.properties[...ConnectionString] = ....
but it seems I can add the assemblies only once. When I call the following example code twice, I recieve an error concerning the compilation of mapping files.
Configuration cfg = new Configuration();
cfg.AddAssembly("NHibernate.Examples");
It's also not very clear to me how i have to keep track of the different connectionstrings into the web service. (I'am new to both web services, silverlight and nhibernate)
|