Can I use Entity Framework or Linq To SQL with Windows 8 Metro Style apps? - database

I'm looking for some kind of ORM that can be used with Metro Style apps. I found lots of posts referring to different SQLite implementations that seem to be working (or not, according to other posts) with Metro style apps, but no working sample projects so far showing an ORM on Windows 8 Metro. Other posts are referring to projects that might work, but not pass the Marketplace certification because of forbidden API calls.
Lots of the information I found is probably outdated, so I'm not sure if i even googled this right.
Has any of you managed to get some kind of ORM up and running in a Windows Metro style app? If possible, I'd like to use EF Code First, but I'm growing desperate, so I'm not too picky.
Thanks for your suggestions,
Adrian

I'm currently using SQLite on a C# Windows 8 Metro App using the code from an experimental branch as explained by Tim Heuer in this post (there's also a video), and it is working great, and it will pass the store certification (Tim Heuer also mentions it in the post).
It is not Entity Framework, but it is the best we have available so far for working with local databases.
Other alternatives:
IndexedDB (It's an HTML5 feature, so it is only for HTML5 apps)
SQLite - AFAIK it works, but doesn't pass the store certification yet
WinRT File Based Database - Interesting, though not as performant as SQLite
Siaqodb - Interesting. Didn't test it yet
Sterling NoSQL OODB - Doesn't support WinRT just yet, but should not be difficult to port... I expect a release soon. It is NoSQL, though.

As Ladislav says, it is currently not possible. You can, however, use WCF Data Services (OData) on the WinRT platform. For more information, see Phani's post on Developing Windows 8 Metro style applications that consume OData.

As far as I know it is not possible because .NET for Metro doesn't even have System.Data namespace and all required classes for accessing databases.

Related

Realm Support for UWP

I am working on a windows 10 app, and I have to store data locally, but I am new to Entity Framework, So kindly suggest me which database technique should i use for storing data locally?
Also please someone let me know if Relam supports windows 10 apps for UWP?
Thanks in advance.
Update: Realm released UWP support.
Check the announcement here: https://news.realm.io/news/realm-mobile-database-for-universal-windows-platform/
Old answer:
There an Issue, realm/realm-core#2059, discussing this topic. So far it's not solved, it seems you're not the first one asking Realm to support UWP. Xamarin is supported, though.
So there's no support right now for the Universal Windows Platform on Realm. Encryption, multi-process support and ARM support seem to be the biggest issues stopping this platform to be supported.
I'm the author of MarcelloDB, which is an object database built to be used / embedded in apps.
It supports UWP and Xamarin(iOs and Android), most of the code is written in a portable class library, so you can port your code across the different platforms easily as well.
It allows you to store plain C# objects (incuding child properties, lists and collections)

Is Silverlight recommended for new development?

At my job we are developing a GIS application which will be developed using Silverlight + .NET
But, I heard that Silverlight will not be supported by Microsoft as also they are stopping Silverlight, is it true ?
Is it suggestable to use Silverlight if so with which version of silverlight we can use. ?
Thanks.,
Use Silverlight 5. Current version have 10 year support, and it better than Flash, java or damn it html.
In the future you can migrate to another .NET-based framework by easily porting code.
About silver light support, you can find these answers from Microsoft Silverlight Support Lifecycle Policy.
Keeping in mind that MS would support these browsers till 2021, I would recommend using Silverlight5 if you really have to use Silverlight.
However for new developments I would recommend you to evaluate Html5 as well.
YES! Silverlight is still the best technology to use for web based Line of Business applications. Silverlight will be supported for another 10 years and it will be available within Windows 8 desktop. Silverlight +[Arc]GIS are a great combination. It is so easy to create full functioning application and with little effort. Silverlight is not dead. It is still a great technology to use that is available on (almost) every platform.
Ultimately it comes down to:
1) What do you know: Are you an HTML/JavaScript ninja? Then use that, do you know Flex better then your own children? Or are you a skilled .Net assassin?
2) How much time do you have? Do you want to learn something new and have gobs of time? Then go for that new shiny object (HTML5) and get yourself some street cred.
This probably belongs on programmers.stackexchange.com. However:
Silverlight will continue to be supported for some time, but all signs point to it no longer being actively developed.
If you want a technology that's actively developed, I'd recommend HTML 5 for web based applications and WinRT for Windows 8+ native applications.
Ultimately, though, you should go with what works best for your situation. After all, WinForms is still used on many successful greenfield projects.
Silverlight is based on the NPAPI architecture that is no longer supported on Google Chrome (from browser version 42 upward) though you can still run it on IE and Firefox. HTML5 is supported on all browsers.
From a career standpoint, using Silverlight (which uses XAML) gets you an easier entry into developing apps for Metro/Windows Store/Universal Windows Apps (these can be developed using HTML5/JS too but you'll find a larger developer base using C#/XAML).
Finally if you're already a WPF developer, it's fastest if you develop for Silverlight. See Silverlight vs Flash vs HTML5.

MVP or MVVM framework for both WPF and .NET CF 3.5 development

I am creating a draft architecture outline for a disconnected client-server platform, that involves multiple different client types. I need to support: web clients, desktop workstations and mobile devices (WM 6.x now and Android later).
I am searching for a MVP or MVVM based framework that would let me to reuse as much of the code and architecture as possible between clients, while:
using WPF for desktop development
using .NET CF 3.5 for Windows Mobile development
This framework does not obviously need to support Android, however I am considering Mono for Android to develop the Android client (for easier maintenance of the whole platform), so portability would have been an added asset.
So far I ruled out:
Prism (does not support WM based mobile devices - Windows Phone 7 only)
MVC# (does not support WPF)
I would appreciate any hints that would aid in researching the subject further.
These MVVM Frameworks work with Windows Phone 7:
Caliburn Micro
MVVM Light (it doesn't advertise it, but I've been to a demo where it was used on WP7)
ReactiveUI (Uses the Reactive Extensions for .NET)
My personal favorite is ReactiveUI, but if you've never used the Reactive Extensions it can be a brain burner at first.
As for UI Composition (you mentioned Prism), there aren't a lot of options, mostly due to reflection restrictions on the phone. I have seen an article where someone got basic MEF working on the phone and MEF is probably all most people need in this situation. You can check out that article here.
Hope this helps.
In my opinion, this would be a custom Framework with a mix of UI Processes for different client types. The business logic or entities can definitely be reused to suit the needs of the view.
I did the same research and I concluded the following (which I did not implement yet):
There aren't any open source MVVM frameworks that support .NETCF. You
can only find MVC or MVP, but not MVVM.
Suggestion: get the source code of an Open Source MVVM framework that supports the Full/Desktop .NET, and see if you can adapt it(so that it recompiles) to the .NETCF. I found the following two, which also support the other platforms that you mentioned:
MVVM FX for Windows Forms and Visual WebGUI - Home
MugenMvvmToolkit
Other than that, I don't see any other way of doing this.
HTH,
MVVM wouldn't make much sense in Windows Mobile + .NETCF since you don't have INotifyPropertyChanged and implementing Model-View-Presenter in WPF or any INotifiyPropertyChanged supported framework wouldn't be as effective as Model-View-ViewModel
You can share assets between the full and compact framework by moving most of the business logic into a seperate class library (or several) that target the .NETCF. You can reference a .NETCF library from a full framework project, but not the other way around.
Check out this very good article by Daniel Moth describing how to share assets between the compact and full framework:
http://msdn.microsoft.com/msdnmag/issues/07/07/ShareCode/default.aspx

Is silverlight the right choice of technology for enterprise applications after Microsoft's comments in PDC 2010

We were beginning to start on an enterprise application using silverlight.
However after reading this post we doubt whether it is the right choice going forward.
The post says that, according to
Microsoft's declaration in PDC 2010,
Microsoft has changed their strategy
regarding silverlight and they no
longer view it as their technology to
deliver cross platform applications.
Instead they are targeting silverlight
as their development platform for
Windows phone 7.
Is this correct? Should we still continue with silverlight or go back to ASP.NET WebForms\MVC?
The Scope of the application is basically intranet with Windows 2008 servers and Windows XP and Windows 7 clients. However a subset of functionality needs to be available to the external users over the internet. There we cannot have any restrictions on what OS users can use.
based on the info you gave, I can't conclude whether silverlight is the way to go. But what I do know is that a number of Microsofties wrote some blogposts about the things said about Silverlight on the pdc. For example John Papa, Bob Muglia and Scott Guthrie.
Update about the scope
I think you already gave the answer when you described the scope of the application. A part of the application will be available to external users and you cannot have any restriction about the OS they are running. With that requirement I think Silverlight is not the best way to go. Not because the rumours about its future but because of its platform indepency. What are the reasons not to go for a ASP.NET/web solution? Silverlight doesn't work on each OS whereas plain HTML will work everywhere. (ok you need a descent browser)
Although for a good advice I'd need more information about the application.
Basically the question you have to ask yourself is this: do you need your application to be used on every platform, i.e. Windows, Mac, Linux, misc. flavors of Unix, IPhone and other mobile platforms?
If that's the case, then a web based solution is the way to go.
If Windows, Mac and partially Linux is enough, then save yourself and your team a lot of pain and use Silverlight.
In my opinion support for mobile clients is the key factor in your decision.
For sure the right platform for Intranet, Enterprice applications Is Silverlight. It is
stable, performs extreamly well, the environment and the development time is huuge less than web application development, the end User Experience is much better and so on and so forth... Once you want to show part of the system out the the intranet - just create some specific target modules that will address the needed audince. You won't have the universal "Reachfull" solution, that will target everyhing, you'll always need mobile versions or other devices and so on. But once you've built your project the right way with Services (same services that the Silverlight app will consume), it'll be easy job to consume them with new UI.
Hope you will choose Silverlihgt.
Silverlight is a great technology, but the Microsoft does not develop it anymore. So as a technology is a great decision. But if you want to make a Silverlight app usable on a NOT supported platform (e.g. Android or iPhone) you have to use 3rd party services. For example http://sl2html.com

Can you build an entire application in Silverlight?

Is it possible to build a good medium to full sized application using just silverlight as a host?
A few things that would be needed:
- dynamic pages (one silverlight "screen" can switch between screens, like a normal app.
- similar to a java applet which launches from the browser
I see that Telerik sells RadControls for WPF...but this is only useful (to me) if Silverlight can be a rich client platform through the web.
Although still a somewhat immature platform, Silverlight 2.0 supports many of the features that I would expect from a platform needed to create full sized applications.
Data access through web services and local data/object query support with Linq
Many feature rich controls such as datagrid, treeview, etc
A very usable subset of the CLR (common language runtime)
Access to restricted local storage on the client machine
It is cross platform
There are already some great add-ons, like Telerik and the Silverlight Control Toolkit
For your specific scenario, Microsoft has published a tutorial on Multi-page Applications
Absolutely. I've been looking into this and believe that it's as easy to do in Silverlight as it is in any other language. Remember that Silverlight 2 uses C# 3.0 and from that you can build anything that's not included in the Silverlight version of the CLR. Also, the fact that Microsoft gives you access to the .NET source code means that you can compile the missing parts of the .NET libraries with your application. (No idea about the licensing issues with that though.)
I've seen a presentation of a full featured CRM application two days ago. Although it's still alpha: It looks and feels like any office application. I don't know details but for me it's a proof of concept.

Resources