Xamarin.Forms 应用程序 SQL 服务器数据库选项 [英] Xamarin.Forms app SQL-server database options

查看:50
本文介绍了Xamarin.Forms 应用程序 SQL 服务器数据库选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在研究 Xamarin.Forms,目标是在 VisualStudio2015 中构建跨平台移动应用程序.我有一个完全可以接受的面向公众的网站,但本机应用程序是老板认为我们需要的.

I've been studying Xamarin.Forms with goal of building cross-platform mobile app in VisualStudio2015. I've got a perfectly acceptable public facing web site but native app(s) are what the boss thinks we need.

当前托管在 IIS 7.5 上的 Web 应用程序使用单独的项目 (DLL) 来访问本地 SQL Server 2008 实例的数据库.这个 VStudio 项目通过使用 System.Data.SqlClient 执行各种存储过程,将域对象公开给调用 ASP.NET webforms.

The current web app hosted on IIS 7.5 uses a separate project(DLL) for database access to an on-premises SQL Server 2008 instance. This VStudio project exposes domain objects to the calling ASP.NET webforms by executing various stored procedures using System.Data.SqlClient.

我知道使用 Xamarin.Forms 构建移动本机应用程序本身是挑战的一部分,但我在这里要求澄清有关如何处理数据库要求的信息:

I know building the mobile native app itself with Xamarin.Forms is one part of the challenge but I am asking here for clarification about how to approach the database requirements:

我是否需要创建某种 Web 服务来提供与当前网站所需的相同 CRUD 功能?

Xamarin 文档列出了使用 Web 服务的几个选项我对数据访问的搜索和阅读越多,我得出的结论是,我最终的原生移动应用将需要某种类型的可调用 Web 服务.

Xamarin documentation lists several options for consuming web services and the more I search and read about data access I conclude that a callable web service of some type is going to be required for my eventual native mobile app.

这个假设正确吗?

推荐答案

是的.您通常需要在您的移动应用程序(或任何远程客户端)和您的数据库服务器之间建立一个网络服务层代理请求.如果您已经将所有 crud 操作放在一个由您的网站使用的单独库中,那么网络服务将只是依赖同一个 CRUD 库的另一组端点.

Yes. You generally want a webservice layer brokering requests between your mobile app (or any remote client) and your DB server. If you already have all your crud operations in a separate library that is utilized by your website, then a webservice would just be another set of endpoints that rely on the same CRUD library.

这篇关于Xamarin.Forms 应用程序 SQL 服务器数据库选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆