Azure Function with Entity Framework or Normal Sql query - azure

Could you please help with what is better where Entity Framework or normal Sql query, I personally would like to use Entity Framework with Linq to SQL however I faced certain challenges today like there is no .ToList() or .FirstOrDefault() option available and also there are compatibilty issues using Entity Framework with .net Standard 2.0, so, anyone experienced the same and help what would be better approach.

According to your description, you need to using the namespace of System.Linq
.ToList() or .FirstOrDefault() option is available at .NET CORE 2.0 and these two method are extension methods under System.Linq. So we need to use System.Linq
namespace.
We can see below screenshot of my project.

Related

How to find the alternative class/method for harmonyOS in androidOs?

I am a fresher who works on HarmonyOS where we have to map android imports to respected to HarmonyOs using an excel sheet, which consists of alternative imports but some are missing in that Excel. where can I find all the alternative methods?
There is no direct substitution or mapping between the methods of HarmonyOS and Android. You need to query the official APIs based on the site requirements to find a method that meets the requirements.
API reference documents provide you guidance in using the APIs of different programming languages, as well as standards and specifications required for app development with these APIs.
Java API References
JS API References
You can refer this example for Java Harmony OS APIs for Android developers.
https://medium.com/huawei-developers/java-harmonyos-api-for-android-developers-cheatsheet-9de077561732
For some classes direct one to one mapping might not be available for now.
In HarmonyOS developer doc there is Reference Document Outline for Java APIs, Native APIs. Please check https://developer.harmonyos.com/en/docs/documentation/doc-references/reference-document-outline-0000001115016824

how to convert azure app insights api response to C# models

so i am able to call app insight's api "https://api.applicationinsights.io/v1/apps/xx/xx/xx" from my C# code.
i can get the json response.
i have this response in json and i want to serialize it into C# objects. do i have to create matching C# classes my self or is there any built in c# models i can use and serialize them?
Not really a direct answer to your question, but instead of consuming REST API directly and doing the conversion/serialization yourself you can simply use Application Insights .Net SDK.
The SDK will do all the necessary conversions for you and give you nice C# objects. The source code for this is also open source and is available here: https://github.com/Azure/azure-sdk-for-net/tree/master/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights.Query.
You can take a look here for all the models available to you for direct use here: https://github.com/Azure/azure-sdk-for-net/tree/master/sdk/applicationinsights/Microsoft.Azure.ApplicationInsights.Query/src/Generated/Models.
In my opinion, if you choose to use app insights api, that means you didn't add any other sdk into your project, that means there's no any built in models for you.
And if you choose to use sdk instead, here's a sample for it, and per my testing, it only provides QueryResults as the response, here's my testing result, and this is the introduction for preparation. Pls note, you need wait for a while to make the newly added role to take effect. If you can't find the api permission mentioned in the document, you can search for it like what I did.

Which is the more suitable approach for database support in Website? "Class Library" or "Web API"

I plan to build website using asp.net mvc 5. But can't use databse direct in application as per my criteria. So now i have two ways, either use Web API or Class Library for database operation.
Note that this website will have to many forms and have lots of database operations.
Please help me to get best decision.
Thanks in advance.
Create a second class library project in your solution, you would still need to do this even if you use WebAPI, encapsulate your database access code in the class library and reference it from your application project. This is encapsulation 101, look up repository pattern.

BreezeJS with ServiceStack?

I was wondering whether or not BreezeJS is compatible when using other technologies other than Web API and/or Entity Framework? As I'm currently in development of a SPA using Service Stack to retrieve data and ORMLite?
So I am curious how BreezeJS handle's this as I know it uses it's own API Controller usually with an extension of the DbContext class which Entity Framework uses. Thanks.
There is currently a sample called NoDb in the samples zip available on the breeze website. This sample does not use EF, but it does use WebApi. So I'd start by looking there. ( additional documentation on this sample should be added within a day or two as well).
In terms of using ServiceStack instead of WebApi, breeze supports the concept of a "dataServiceAdapter" and currently ships with two, an OData adapter and a WebApi adapter. It is certainly possible to write a ServiceStack adapter that breeze could use but this is not trivial. Please add this as a feature request ( and vote for it) on the breeze User Voice. We take these requests seriously.

Subsonic with VistaDB?

Is it possible to use Subsonic with VistaDB? I see it as a supported database for Subsonic 3 on the project website, But can't find a T4 template for it?
Will I need to use SR or I can use AR?
Vikas
Although the underlying architecture of SubSonic (System.Data.Common) supports VistaDB there aren't currently any templates for it. So although in theory it's supported it won't be supported in practice until someone creates those templates.
I wrote a vistadb provider for subsonic 2.x that was never made part of the official project. The main reason it's not in subsonic is that it's not freely available, the required dll for it is very encumbered with licensing. So no one wanted the hassle. You could take this provider code and use it to prepare a template, or just copy the sql server template, and make the required edits for reading the schema. I don't think that vistadb will ever be an official part of subsonic 3 since the vistadb dll is not freely available even for testing. I dropped vistadb because of performance issues.

Resources