Я создал решение, используя пустой шаблон asp.net. Я addred Ormlite и MySql Servicestatck библиотеки и сконфигурированный их в Apphost.csServiceStack Использование Ormlite в ServiceInterface
ConnectionStringSettings connstring = ConfigUtils.GetConnectionStringSetting("Nice2NoConnection");
container.Register<IDbConnectionFactory>(new OrmLiteConnectionFactory(connstring.ToString(), MySqlDialectProvider.Instance));
// Below we refer to the connection factory that we just registered
// with the container and use it to create our table(s).
using (var db = container.Resolve<IDbConnectionFactory>().Open())
{
// We’re just creating a single table, but you could add
// as many as you need. Also note the “overwrite: false” parameter,
// this will only create the table if it doesn’t already exist.
db.CreateTable<Channel>(overwrite: false);
Что у меня возникают проблемы, выяснить, как получить доступ к OrmliteWriteExtensions, которые включают Save() в проекте ServiceInterface. Я попытался добавить Ormlite и MySql, но не знаю, как получить доступ к ссылке connectionfactory в этом проекте.
Я думаю, что моя проблема связана с отсутствием более глубокого понимания IoC. Я, вероятно, слишком усложняю что-то здесь.
Предложения?
ТИА